mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
[packages/policy] use package feerate in package validation
This allows CPFP within a package prior to submission to mempool.
This commit is contained in:
@@ -234,11 +234,19 @@ struct PackageMempoolAcceptResult
|
||||
* was a package-wide error (see result in m_state), m_tx_results will be empty.
|
||||
*/
|
||||
std::map<const uint256, const MempoolAcceptResult> m_tx_results;
|
||||
/** Package feerate, defined as the aggregated modified fees divided by the total virtual size
|
||||
* of all transactions in the package. May be unavailable if some inputs were not available or
|
||||
* a transaction failure caused validation to terminate early. */
|
||||
std::optional<CFeeRate> m_package_feerate;
|
||||
|
||||
explicit PackageMempoolAcceptResult(PackageValidationState state,
|
||||
std::map<const uint256, const MempoolAcceptResult>&& results)
|
||||
: m_state{state}, m_tx_results(std::move(results)) {}
|
||||
|
||||
explicit PackageMempoolAcceptResult(PackageValidationState state, CFeeRate feerate,
|
||||
std::map<const uint256, const MempoolAcceptResult>&& results)
|
||||
: m_state{state}, m_tx_results(std::move(results)), m_package_feerate{feerate} {}
|
||||
|
||||
/** Constructor to create a PackageMempoolAcceptResult from a single MempoolAcceptResult */
|
||||
explicit PackageMempoolAcceptResult(const uint256& wtxid, const MempoolAcceptResult& result)
|
||||
: m_tx_results{ {wtxid, result} } {}
|
||||
|
||||
Reference in New Issue
Block a user