This PR fixes a bug and improves the mempool accept interface to return information more predictably.
Bug: In package validation, we first try the transactions individually (see doc/policy/packages.md for more explanation) and, if they all failed for missing inputs and policy-related (i.e. fee) reasons, we’ll try package validation. Otherwise, we’ll just “quit early” since, for example, if a transaction had an invalid signature, adding a child will not help make it valid. Currently, when we quit early, we’re not setting the package_state
to be invalid, so the caller might think it succeeded. Also, we’re returning no results - it makes more sense to return the individual transaction failure. Thanks instagibbs for catching #25038 (review)!
Also, make the package results interface generally more useful/predictable:
- Always return the feerate at which a transaction was considered for
CheckFeeRate
inMempoolAcceptResult::m_effective_feerate
when it was successful. This can replace the currentPackageMempoolAcceptResult::m_package_feerate
, which only sometimes exists. - Always provide an entry for every transaction in
PackageMempoolAcceptResult::m_tx_results
when the error isPCKG_TX
.