@@ -49,11 +49,11 @@ std::optional<std::string> CheckPackageMempoolAcceptResult(const Package& txns,
49
49
}
50
50
} else {
51
51
if (result.m_state .IsValid ()) {
52
- strprintf (" Package validation unexpectedly succeeded. %s" , result.m_state .ToString ());
52
+ return strprintf (" Package validation unexpectedly succeeded. %s" , result.m_state .ToString ());
53
53
}
54
54
}
55
55
if (result.m_state .GetResult () != PackageValidationResult::PCKG_POLICY && txns.size () != result.m_tx_results .size ()) {
56
- strprintf (" txns size %u does not match tx results size %u" , txns.size (), result.m_tx_results .size ());
56
+ return strprintf (" txns size %u does not match tx results size %u" , txns.size (), result.m_tx_results .size ());
57
57
}
58
58
for (const auto & tx : txns) {
59
59
const auto & wtxid = tx->GetWitnessHash ();
@@ -102,12 +102,12 @@ std::optional<std::string> CheckPackageMempoolAcceptResult(const Package& txns,
102
102
// The tx by txid should be in the mempool iff the result was not INVALID.
103
103
const bool txid_in_mempool{atmp_result.m_result_type != MempoolAcceptResult::ResultType::INVALID};
104
104
if (mempool->exists (GenTxid::Txid (tx->GetHash ())) != txid_in_mempool) {
105
- strprintf (" tx %s should %sbe in mempool" , wtxid.ToString (), txid_in_mempool ? " " : " not " );
105
+ return strprintf (" tx %s should %sbe in mempool" , wtxid.ToString (), txid_in_mempool ? " " : " not " );
106
106
}
107
107
// Additionally, if the result was DIFFERENT_WITNESS, we shouldn't be able to find the tx in mempool by wtxid.
108
108
if (tx->HasWitness () && atmp_result.m_result_type == MempoolAcceptResult::ResultType::DIFFERENT_WITNESS) {
109
109
if (mempool->exists (GenTxid::Wtxid (wtxid))) {
110
- strprintf (" wtxid %s should not be in mempool" , wtxid.ToString ());
110
+ return strprintf (" wtxid %s should not be in mempool" , wtxid.ToString ());
111
111
}
112
112
}
113
113
}
0 commit comments