Skip to content

Commit

Permalink
Validation: DisconnectTip doesn't need to force a flush to disk.
Browse files Browse the repository at this point in the history
This is highly slowing down the invalidate block/chain process for no reason.
  • Loading branch information
furszy committed Feb 24, 2021
1 parent f8cd371 commit 53497f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ bool static DisconnectTip(CValidationState& state, const CChainParams& chainpara
LogPrint(BCLog::BENCH, "- Disconnect block: %.2fms\n", (GetTimeMicros() - nStart) * 0.001);
const uint256& saplingAnchorAfterDisconnect = pcoinsTip->GetBestAnchor();
// Write the chain state to disk, if necessary.
if (!FlushStateToDisk(state, FLUSH_STATE_ALWAYS))
if (!FlushStateToDisk(state, FLUSH_STATE_IF_NEEDED))
return false;
// Resurrect mempool transactions from the disconnected block.
std::vector<uint256> vHashUpdate;
Expand Down

0 comments on commit 53497f0

Please sign in to comment.