mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-15 09:09:46 +02:00
Merge bitcoin/bitcoin#35017: mempool: remove all subsequent tx in pkg on failure
ac9aa71b7fmempool: remove all subsequent tx in pkg on failure (Greg Sanders) Pull request description: This belt-and-suspenders check, if ever hit in production, could result in an inconsistent mempool if somehow the parent failed in the ConsensusScriptChecks but the child did not. Rather than allow the mempool to get in an inconsistent state, remove the following txs in the package. ACKs for top commit: ismaelsadeeq: Code review ACKac9aa71b7fmarcofleon: ACKac9aa71b7fsedited: ACKac9aa71b7fTree-SHA512: c25310045fa4dfd40bd38c9d54fff3f9fdb817e617154444d4691576393eee5f9cc86e26c59ddcdeef20eb6dddab0a168e91aec85c8291e6d68abbcb333d24f8
This commit is contained in:
@@ -1261,7 +1261,9 @@ bool MemPoolAccept::SubmitPackage(const ATMPArgs& args, std::vector<Workspace>&
|
||||
package_state.Invalid(PackageValidationResult::PCKG_MEMPOOL_ERROR,
|
||||
strprintf("BUG! PolicyScriptChecks succeeded but ConsensusScriptChecks failed: %s",
|
||||
ws.m_ptx->GetHash().ToString()));
|
||||
// Remove the transaction from the mempool.
|
||||
}
|
||||
// Remove first failing tx and all subsequent in package
|
||||
if (!all_submitted) {
|
||||
if (!m_subpackage.m_changeset) m_subpackage.m_changeset = m_pool.GetChangeSet();
|
||||
m_subpackage.m_changeset->StageRemoval(m_pool.GetIter(ws.m_ptx->GetHash()).value());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user