disconnect notarisations

This commit is contained in:
Scott Sadler
2018-05-28 23:31:42 -03:00
parent 0ffacf04dc
commit 69c67b5117
4 changed files with 28 additions and 11 deletions

View File

@@ -47,11 +47,21 @@ bool GetBackNotarisation(uint256 notarisationHash, Notarisation &n)
/*
* Write an index of KMD notarisation id -> backnotarisation
*/
void WriteBackNotarisations(NotarisationsInBlock notarisations)
void WriteBackNotarisations(const NotarisationsInBlock notarisations)
{
BOOST_FOREACH(Notarisation &n, notarisations)
BOOST_FOREACH(const Notarisation &n, notarisations)
{
if (n.second.IsBackNotarisation)
if (!n.second.txHash.IsNull())
pnotarisations->Write(n.second.txHash, n);
}
}
void EraseBackNotarisations(const NotarisationsInBlock notarisations)
{
BOOST_FOREACH(const Notarisation &n, notarisations)
{
if (!n.second.txHash.IsNull())
pnotarisations->Erase(n.second.txHash);
}
}