Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
MempoolAcceptResult Struct Reference

Validation result for a transaction evaluated by MemPoolAccept (single or package). More...

#include <validation.h>

Collaboration diagram for MempoolAcceptResult:
[legend]

Public Types

enum class  ResultType { VALID , INVALID , MEMPOOL_ENTRY }
 Used to indicate the results of mempool validation. More...
 

Static Public Member Functions

static MempoolAcceptResult Failure (TxValidationState state)
 
static MempoolAcceptResult FeeFailure (TxValidationState state, CFeeRate effective_feerate, const std::vector< TxId > &txids_fee_calculations)
 
static MempoolAcceptResult Success (int64_t vsize, Amount fees, CFeeRate effective_feerate, const std::vector< TxId > &txids_fee_calculations)
 Constructor for success case.
 
static MempoolAcceptResult MempoolTx (int64_t vsize, Amount fees)
 Constructor for already-in-mempool case.
 

Public Attributes

const ResultType m_result_type
 Result type.
 
const TxValidationState m_state
 Contains information about why the transaction failed.
 
const std::optional< int64_tm_vsize
 Virtual size as used by the mempool, calculated using serialized size and sigchecks.
 
const std::optional< Amountm_base_fees
 Raw base fees in satoshis.
 
const std::optional< CFeeRatem_effective_feerate
 The feerate at which this transaction was considered.
 
const std::optional< std::vector< TxId > > m_txids_fee_calculations
 Contains the txids of the transactions used for fee-related checks.
 

Private Member Functions

 MempoolAcceptResult (TxValidationState state)
 Constructor for failure case.
 
 MempoolAcceptResult (ResultType result_type, int64_t vsize, Amount fees, CFeeRate effective_feerate, const std::vector< TxId > &txids_fee_calculations)
 Generic constructor for success cases.
 
 MempoolAcceptResult (TxValidationState state, CFeeRate effective_feerate, const std::vector< TxId > &txids_fee_calculations)
 Constructor for fee-related failure case.
 
 MempoolAcceptResult (int64_t vsize, Amount fees)
 Constructor for already-in-mempool case.
 

Detailed Description

Validation result for a transaction evaluated by MemPoolAccept (single or package).

Here are the expected fields and properties of a result depending on its ResultType, applicable to results returned from package evaluation: +-----------------------—+--------—+----------------------------------------—+------------—+ | Field or property | VALID | INVALID | MEMPOOL_ENTRY | | | |----------------------------------------—| | | | | TX_PACKAGE_RECONSIDERABLE | Other | | +-----------------------—+--------—+------------------------—+------------—+------------—+ | txid in mempool? | yes | no | no* | yes | | m_state | IsValid() | IsInvalid() | IsInvalid() | IsValid() | | m_replaced_transactions | yes | no | no | no | | m_vsize | yes | no | no | yes | | m_base_fees | yes | no | no | yes | | m_effective_feerate | yes | yes | no | no | | m_txids_fee_calculations | yes | yes | no | no | +-----------------------—+--------—+------------------------—+------------—+------------—+ (*) Individual transaction acceptance doesn't return MEMPOOL_ENTRY. It returns INVALID, with the error txn-already-in-mempool. In this case, the txid may be in the mempool for a tx conflict (TX_AVALANCHE_RECONSIDERABLE).

Definition at line 207 of file validation.h.

Member Enumeration Documentation

◆ ResultType

Used to indicate the results of mempool validation.

Enumerator
VALID 

Fully validated, valid.

INVALID 

Invalid.

MEMPOOL_ENTRY 

Valid, transaction was already in the mempool.

Definition at line 209 of file validation.h.

Constructor & Destructor Documentation

◆ MempoolAcceptResult() [1/4]

MempoolAcceptResult::MempoolAcceptResult ( TxValidationState  state)
inlineexplicitprivate

Constructor for failure case.

Definition at line 277 of file validation.h.

Here is the call graph for this function:

◆ MempoolAcceptResult() [2/4]

MempoolAcceptResult::MempoolAcceptResult ( ResultType  result_type,
int64_t  vsize,
Amount  fees,
CFeeRate  effective_feerate,
const std::vector< TxId > &  txids_fee_calculations 
)
inlineexplicitprivate

Generic constructor for success cases.

Definition at line 285 of file validation.h.

◆ MempoolAcceptResult() [3/4]

MempoolAcceptResult::MempoolAcceptResult ( TxValidationState  state,
CFeeRate  effective_feerate,
const std::vector< TxId > &  txids_fee_calculations 
)
inlineexplicitprivate

Constructor for fee-related failure case.

Definition at line 294 of file validation.h.

◆ MempoolAcceptResult() [4/4]

MempoolAcceptResult::MempoolAcceptResult ( int64_t  vsize,
Amount  fees 
)
inlineexplicitprivate

Constructor for already-in-mempool case.

Definition at line 302 of file validation.h.

Member Function Documentation

◆ Failure()

static MempoolAcceptResult MempoolAcceptResult::Failure ( TxValidationState  state)
inlinestatic

Definition at line 246 of file validation.h.

Here is the caller graph for this function:

◆ FeeFailure()

static MempoolAcceptResult MempoolAcceptResult::FeeFailure ( TxValidationState  state,
CFeeRate  effective_feerate,
const std::vector< TxId > &  txids_fee_calculations 
)
inlinestatic

Definition at line 251 of file validation.h.

Here is the call graph for this function:

◆ MempoolTx()

static MempoolAcceptResult MempoolAcceptResult::MempoolTx ( int64_t  vsize,
Amount  fees 
)
inlinestatic

Constructor for already-in-mempool case.

It wouldn't replace any transactions.

Definition at line 269 of file validation.h.

◆ Success()

static MempoolAcceptResult MempoolAcceptResult::Success ( int64_t  vsize,
Amount  fees,
CFeeRate  effective_feerate,
const std::vector< TxId > &  txids_fee_calculations 
)
inlinestatic

Constructor for success case.

Definition at line 259 of file validation.h.

Here is the call graph for this function:

Member Data Documentation

◆ m_base_fees

const std::optional<Amount> MempoolAcceptResult::m_base_fees

Raw base fees in satoshis.

Definition at line 229 of file validation.h.

◆ m_effective_feerate

const std::optional<CFeeRate> MempoolAcceptResult::m_effective_feerate

The feerate at which this transaction was considered.

This includes any fee delta added using prioritisetransaction (i.e. modified fees). If this transaction was submitted as a package, this is the package feerate, which may also include its descendants and/or ancestors (see m_txids_fee_calculations below).

Definition at line 237 of file validation.h.

◆ m_result_type

const ResultType MempoolAcceptResult::m_result_type

Result type.

Present in all MempoolAcceptResults.

Definition at line 218 of file validation.h.

◆ m_state

const TxValidationState MempoolAcceptResult::m_state

Contains information about why the transaction failed.

Definition at line 221 of file validation.h.

◆ m_txids_fee_calculations

const std::optional<std::vector<TxId> > MempoolAcceptResult::m_txids_fee_calculations

Contains the txids of the transactions used for fee-related checks.

Includes this transaction's txid and may include others if this transaction was validated as part of a package. This is not necessarily equivalent to the list of transactions passed to ProcessNewPackage().

Definition at line 244 of file validation.h.

◆ m_vsize

const std::optional<int64_t> MempoolAcceptResult::m_vsize

Virtual size as used by the mempool, calculated using serialized size and sigchecks.

Definition at line 227 of file validation.h.


The documentation for this struct was generated from the following file: