Skip to content

Commit 91a6736

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#25009: Crash debug builds on PCKG_MEMPOOL_ERROR
fa10c9f Crash debug builds on PCKG_MEMPOOL_ERROR (MacroFake) Pull request description: Would be nice to allow fuzz targets to meaningfully cover this code ACKs for top commit: glozow: utACK fa10c9f vincenzopalazzo: ACK bitcoin/bitcoin@fa10c9f Tree-SHA512: 68efacedbf72f67cf3dc0bb9927a698492cdc1b08df91ef6af863ad8828b78058a64e52d64d244a5b2966cb9e63797b2647d1bb222677bf83b26fca6e4b1dbf0
2 parents 606ce05 + fa10c9f commit 91a6736

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/validation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,7 @@ bool MemPoolAccept::SubmitPackage(const ATMPArgs& args, std::vector<Workspace>&
11161116
if (!ConsensusScriptChecks(args, ws)) {
11171117
results.emplace(ws.m_ptx->GetWitnessHash(), MempoolAcceptResult::Failure(ws.m_state));
11181118
// Since PolicyScriptChecks() passed, this should never fail.
1119+
Assume(false);
11191120
all_submitted = false;
11201121
package_state.Invalid(PackageValidationResult::PCKG_MEMPOOL_ERROR,
11211122
strprintf("BUG! PolicyScriptChecks succeeded but ConsensusScriptChecks failed: %s",
@@ -1130,6 +1131,7 @@ bool MemPoolAccept::SubmitPackage(const ATMPArgs& args, std::vector<Workspace>&
11301131
m_limit_descendant_size, unused_err_string)) {
11311132
results.emplace(ws.m_ptx->GetWitnessHash(), MempoolAcceptResult::Failure(ws.m_state));
11321133
// Since PreChecks() and PackageMempoolChecks() both enforce limits, this should never fail.
1134+
Assume(false);
11331135
all_submitted = false;
11341136
package_state.Invalid(PackageValidationResult::PCKG_MEMPOOL_ERROR,
11351137
strprintf("BUG! Mempool ancestors or descendants were underestimated: %s",
@@ -1143,6 +1145,7 @@ bool MemPoolAccept::SubmitPackage(const ATMPArgs& args, std::vector<Workspace>&
11431145
if (!Finalize(args, ws)) {
11441146
results.emplace(ws.m_ptx->GetWitnessHash(), MempoolAcceptResult::Failure(ws.m_state));
11451147
// Since LimitMempoolSize() won't be called, this should never fail.
1148+
Assume(false);
11461149
all_submitted = false;
11471150
package_state.Invalid(PackageValidationResult::PCKG_MEMPOOL_ERROR,
11481151
strprintf("BUG! Adding to mempool failed: %s", ws.m_ptx->GetHash().ToString()));

0 commit comments

Comments
 (0)