@@ -1058,7 +1058,10 @@ bool MemPoolAccept::SubmitPackage(const ATMPArgs& args, std::vector<Workspace>&
1058
1058
if (!ConsensusScriptChecks (args, ws)) {
1059
1059
results.emplace (ws.m_ptx ->GetWitnessHash (), MempoolAcceptResult::Failure (ws.m_state ));
1060
1060
// 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 ()));
1062
1065
}
1063
1066
1064
1067
// 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>&
1069
1072
m_limit_descendant_size, unused_err_string)) {
1070
1073
results.emplace (ws.m_ptx ->GetWitnessHash (), MempoolAcceptResult::Failure (ws.m_state ));
1071
1074
// 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 ()));
1073
1079
}
1074
1080
// If we call LimitMempoolSize() for each individual Finalize(), the mempool will not take
1075
1081
// 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>&
1079
1085
if (!Finalize (args, ws)) {
1080
1086
results.emplace (ws.m_ptx ->GetWitnessHash (), MempoolAcceptResult::Failure (ws.m_state ));
1081
1087
// 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 ()));
1083
1091
}
1084
1092
}
1085
1093
@@ -1088,7 +1096,6 @@ bool MemPoolAccept::SubmitPackage(const ATMPArgs& args, std::vector<Workspace>&
1088
1096
LimitMempoolSize (m_pool, m_active_chainstate.CoinsTip (),
1089
1097
gArgs .GetIntArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 ,
1090
1098
std::chrono::hours{gArgs .GetIntArg (" -mempoolexpiry" , DEFAULT_MEMPOOL_EXPIRY)});
1091
- if (!all_submitted) return false ;
1092
1099
1093
1100
// Find the wtxids of the transactions that made it into the mempool. Allow partial submission,
1094
1101
// but don't report success unless they all made it into the mempool.
@@ -1194,7 +1201,7 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptMultipleTransactions(const std::
1194
1201
if (args.m_test_accept ) return PackageMempoolAcceptResult (package_state, std::move (results));
1195
1202
1196
1203
if (!SubmitPackage (args, workspaces, package_state, results)) {
1197
- package_state. Invalid (PackageValidationResult::PCKG_TX, " submission failed " );
1204
+ // PackageValidationState filled in by SubmitPackage().
1198
1205
return PackageMempoolAcceptResult (package_state, std::move (results));
1199
1206
}
1200
1207
0 commit comments