Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 2,647 Lines • ▼ Show 20 Lines | static bool DisconnectTip(const Config &config, CValidationState &state, | ||||
// add the transaction of the block we just disconnected back. | // add the transaction of the block we just disconnected back. | ||||
// | // | ||||
// Samewise, if this block enabled the monolith opcodes, then we need to | // Samewise, if this block enabled the monolith opcodes, then we need to | ||||
// clear the mempool of any transaction using them. | // clear the mempool of any transaction using them. | ||||
if ((IsReplayProtectionEnabled(config, pindexDelete) && | if ((IsReplayProtectionEnabled(config, pindexDelete) && | ||||
!IsReplayProtectionEnabled(config, pindexDelete->pprev)) || | !IsReplayProtectionEnabled(config, pindexDelete->pprev)) || | ||||
(IsMonolithEnabled(config, pindexDelete) && | (IsMonolithEnabled(config, pindexDelete) && | ||||
!IsMonolithEnabled(config, pindexDelete->pprev))) { | !IsMonolithEnabled(config, pindexDelete->pprev))) { | ||||
LogPrint(BCLog::MEMPOOL, "Clearing mempool for reorg"); | |||||
mempool.clear(); | mempool.clear(); | ||||
// While not strictly necessary, clearing the disconnect pool is also | // While not strictly necessary, clearing the disconnect pool is also | ||||
// beneficial so we don't try to reuse its content at the end of the | // beneficial so we don't try to reuse its content at the end of the | ||||
// reorg, which we know will fail. | // reorg, which we know will fail. | ||||
if (disconnectpool) { | if (disconnectpool) { | ||||
disconnectpool->clear(); | disconnectpool->clear(); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,867 Lines • Show Last 20 Lines |