Fix ConnectTip() from thread_notify merge

This commit is contained in:
Duke Leto
2020-03-09 11:04:36 -04:00
parent 9c4acae5fd
commit ad4d87c653

View File

@@ -4157,8 +4157,8 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
assert(pindexNew->pprev == chainActive.Tip());
// Read block from disk.
int64_t nTime1 = GetTimeMicros();
CBlock block;
if (!pblock) {
CBlock block;
if (!ReadBlockFromDisk(block, pindexNew,1))
return AbortNode(state, "Failed to read block");
pblock = █
@@ -4203,6 +4203,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
}
int64_t nTime5 = GetTimeMicros(); nTimeChainState += nTime5 - nTime4;
LogPrint("bench", " - Writing chainstate: %.2fms [%.2fs]\n", (nTime5 - nTime4) * 0.001, nTimeChainState * 0.000001);
// Remove conflicting transactions from the mempool.
std::list<CTransaction> txConflicted;
mempool.removeForBlock(pblock->vtx, pindexNew->GetHeight(), txConflicted, !IsInitialBlockDownload());
@@ -4212,8 +4213,6 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
// Update chainActive & related variables.
UpdateTip(pindexNew);
if ( KOMODO_NSPV_FULLNODE )
{
// Cache the conflicted transactions for subsequent notification.
// Updates to connected wallets are triggered by ThreadNotifyWallets
@@ -4254,7 +4253,6 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
//fprintf(stderr,"%s: returning true\n", __FUNCTION__);
return true;
}
}
std::pair<std::map<CBlockIndex*, std::list<CTransaction>>, uint64_t> DrainRecentlyConflicted()
{
uint64_t recentlyConflictedSequence;