ntz yeah you know me
This commit is contained in:
@@ -2906,32 +2906,28 @@ static bool ApplyTxInUndo(const CTxInUndo& undo, CCoinsViewCache& view, const CO
|
|||||||
return fClean;
|
return fClean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ConnectNotarizations(const CBlock &block, int height)
|
void ConnectNotarizations(const CBlock &block, int height)
|
||||||
{
|
{
|
||||||
// Record Notarisations
|
|
||||||
NotarisationsInBlock notarisations = ScanBlockNotarisations(block, height);
|
NotarisationsInBlock notarisations = ScanBlockNotarisations(block, height);
|
||||||
if (notarisations.size() > 0) {
|
if (notarisations.size() > 0) {
|
||||||
CDBBatch batch = CDBBatch(*pnotarisations);
|
CDBBatch batch = CDBBatch(*pnotarisations);
|
||||||
batch.Write(block.GetHash(), notarisations);
|
batch.Write(block.GetHash(), notarisations);
|
||||||
WriteBackNotarisations(notarisations, batch);
|
WriteBackNotarisations(notarisations, batch);
|
||||||
pnotarisations->WriteBatch(batch, true);
|
pnotarisations->WriteBatch(batch, true);
|
||||||
LogPrintf("ConnectBlock: wrote %i block notarisations in block: %s\n",
|
LogPrintf("ConnectBlock: wrote %i block notarizations in block: %s\n",
|
||||||
notarisations.size(), block.GetHash().GetHex().data());
|
notarisations.size(), block.GetHash().GetHex().data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DisconnectNotarizations(const CBlock &block)
|
void DisconnectNotarizations(const CBlock &block)
|
||||||
{
|
{
|
||||||
// Delete from notarisations cache
|
|
||||||
NotarisationsInBlock nibs;
|
NotarisationsInBlock nibs;
|
||||||
if (GetBlockNotarisations(block.GetHash(), nibs)) {
|
if (GetBlockNotarisations(block.GetHash(), nibs)) {
|
||||||
CDBBatch batch = CDBBatch(*pnotarisations);
|
CDBBatch batch = CDBBatch(*pnotarisations);
|
||||||
batch.Erase(block.GetHash());
|
batch.Erase(block.GetHash());
|
||||||
EraseBackNotarisations(nibs, batch);
|
EraseBackNotarisations(nibs, batch);
|
||||||
pnotarisations->WriteBatch(batch, true);
|
pnotarisations->WriteBatch(batch, true);
|
||||||
LogPrintf("DisconnectTip: deleted %i block notarisations in block: %s\n",
|
LogPrintf("DisconnectTip: deleted %i block notarizations in block: %s\n",
|
||||||
nibs.size(), block.GetHash().GetHex().data());
|
nibs.size(), block.GetHash().GetHex().data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user