mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
[refactor] make MempoolAcceptResult::m_replaced_transactions non-optional
This commit is contained in:
@@ -68,12 +68,6 @@ std::optional<std::string> CheckPackageMempoolAcceptResult(const Package& txns,
|
||||
return strprintf("tx %s unexpectedly failed: %s", wtxid.ToString(), atmp_result.m_state.ToString());
|
||||
}
|
||||
|
||||
//m_replaced_transactions should exist iff the result was VALID
|
||||
if (atmp_result.m_replaced_transactions.has_value() != valid) {
|
||||
return strprintf("tx %s result should %shave m_replaced_transactions",
|
||||
wtxid.ToString(), valid ? "" : "not ");
|
||||
}
|
||||
|
||||
// m_vsize and m_base_fees should exist iff the result was VALID or MEMPOOL_ENTRY
|
||||
const bool mempool_entry{atmp_result.m_result_type == MempoolAcceptResult::ResultType::MEMPOOL_ENTRY};
|
||||
if (atmp_result.m_base_fees.has_value() != (valid || mempool_entry)) {
|
||||
|
||||
Reference in New Issue
Block a user