Update cached incremental witnesses when the active block chain tip changes

This commit is contained in:
Jack Grigg
2016-08-24 15:52:43 +12:00
parent be74c80deb
commit 769e031c1a
5 changed files with 21 additions and 0 deletions

View File

@@ -2403,6 +2403,8 @@ bool static DisconnectTip(CValidationState &state) {
BOOST_FOREACH(const CTransaction &tx, block.vtx) {
SyncWithWallets(tx, NULL);
}
// Update cached incremental witnesses
GetMainSignals().ChainTip(pindexDelete, &block, false);
return true;
}
@@ -2468,6 +2470,8 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
BOOST_FOREACH(const CTransaction &tx, pblock->vtx) {
SyncWithWallets(tx, pblock);
}
// Update cached incremental witnesses
GetMainSignals().ChainTip(pindexNew, pblock, true);
int64_t nTime6 = GetTimeMicros(); nTimePostConnect += nTime6 - nTime5; nTimeTotal += nTime6 - nTime1;
LogPrint("bench", " - Connect postprocess: %.2fms [%.2fs]\n", (nTime6 - nTime5) * 0.001, nTimePostConnect * 0.000001);