@@ -1058,7 +1058,10 @@ bool MemPoolAccept::SubmitPackage(const ATMPArgs& args, std::vector<Workspace>&
10581058 if (!ConsensusScriptChecks (args, ws)) {
10591059 results.emplace (ws.m_ptx ->GetWitnessHash (), MempoolAcceptResult::Failure (ws.m_state ));
10601060 // Since PolicyScriptChecks() passed, this should never fail.
1061- all_submitted = Assume (false );
1061+ all_submitted = false ;
1062+ package_state.Invalid (PackageValidationResult::PCKG_MEMPOOL_ERROR,
1063+ strprintf (" BUG! PolicyScriptChecks succeeded but ConsensusScriptChecks failed: %s" ,
1064+ ws.m_ptx ->GetHash ().ToString ()));
10621065 }
10631066
10641067 // Re-calculate mempool ancestors to call addUnchecked(). They may have changed since the
@@ -1069,7 +1072,10 @@ bool MemPoolAccept::SubmitPackage(const ATMPArgs& args, std::vector<Workspace>&
10691072 m_limit_descendant_size, unused_err_string)) {
10701073 results.emplace (ws.m_ptx ->GetWitnessHash (), MempoolAcceptResult::Failure (ws.m_state ));
10711074 // Since PreChecks() and PackageMempoolChecks() both enforce limits, this should never fail.
1072- all_submitted = Assume (false );
1075+ all_submitted = false ;
1076+ package_state.Invalid (PackageValidationResult::PCKG_MEMPOOL_ERROR,
1077+ strprintf (" BUG! Mempool ancestors or descendants were underestimated: %s" ,
1078+ ws.m_ptx ->GetHash ().ToString ()));
10731079 }
10741080 // If we call LimitMempoolSize() for each individual Finalize(), the mempool will not take
10751081 // the transaction's descendant feerate into account because it hasn't seen them yet. Also,
@@ -1079,7 +1085,9 @@ bool MemPoolAccept::SubmitPackage(const ATMPArgs& args, std::vector<Workspace>&
10791085 if (!Finalize (args, ws)) {
10801086 results.emplace (ws.m_ptx ->GetWitnessHash (), MempoolAcceptResult::Failure (ws.m_state ));
10811087 // Since LimitMempoolSize() won't be called, this should never fail.
1082- all_submitted = Assume (false );
1088+ all_submitted = false ;
1089+ package_state.Invalid (PackageValidationResult::PCKG_MEMPOOL_ERROR,
1090+ strprintf (" BUG! Adding to mempool failed: %s" , ws.m_ptx ->GetHash ().ToString ()));
10831091 }
10841092 }
10851093
@@ -1088,7 +1096,6 @@ bool MemPoolAccept::SubmitPackage(const ATMPArgs& args, std::vector<Workspace>&
10881096 LimitMempoolSize (m_pool, m_active_chainstate.CoinsTip (),
10891097 gArgs .GetIntArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 ,
10901098 std::chrono::hours{gArgs .GetIntArg (" -mempoolexpiry" , DEFAULT_MEMPOOL_EXPIRY)});
1091- if (!all_submitted) return false ;
10921099
10931100 // Find the wtxids of the transactions that made it into the mempool. Allow partial submission,
10941101 // but don't report success unless they all made it into the mempool.
@@ -1194,7 +1201,7 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptMultipleTransactions(const std::
11941201 if (args.m_test_accept ) return PackageMempoolAcceptResult (package_state, std::move (results));
11951202
11961203 if (!SubmitPackage (args, workspaces, package_state, results)) {
1197- package_state. Invalid (PackageValidationResult::PCKG_TX, " submission failed " );
1204+ // PackageValidationState filled in by SubmitPackage().
11981205 return PackageMempoolAcceptResult (package_state, std::move (results));
11991206 }
12001207
0 commit comments