fixes for import coin

This commit is contained in:
Scott Sadler
2018-06-10 15:12:10 +02:00
parent 7776d00b9a
commit 89cfc4272d
6 changed files with 36 additions and 7 deletions

View File

@@ -63,19 +63,23 @@ bool GetBackNotarisation(uint256 notarisationHash, Notarisation &n)
*/
void WriteBackNotarisations(const NotarisationsInBlock notarisations)
{
CLevelDBBatch batch;
BOOST_FOREACH(const Notarisation &n, notarisations)
{
if (!n.second.txHash.IsNull())
pnotarisations->Write(n.second.txHash, n);
batch.Write(n.second.txHash, n);
}
pnotarisations->WriteBatch(batch, true);
}
void EraseBackNotarisations(const NotarisationsInBlock notarisations)
{
CLevelDBBatch batch;
BOOST_FOREACH(const Notarisation &n, notarisations)
{
if (!n.second.txHash.IsNull())
pnotarisations->Erase(n.second.txHash);
batch.Erase(n.second.txHash);
}
pnotarisations->WriteBatch(batch, true);
}