diff --git a/src/main.cpp b/src/main.cpp index d069c7068..bed9d6ac8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 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>, uint64_t> DrainRecentlyConflicted() { uint64_t recentlyConflictedSequence;