Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | |||||
* Validation result for package mempool acceptance. | * Validation result for package mempool acceptance. | ||||
*/ | */ | ||||
struct PackageMempoolAcceptResult { | struct PackageMempoolAcceptResult { | ||||
const PackageValidationState m_state; | const PackageValidationState m_state; | ||||
/** | /** | ||||
* Map from txid to finished MempoolAcceptResults. The client is | * Map from txid to finished MempoolAcceptResults. The client is | ||||
* responsible for keeping track of the transaction objects themselves. | * responsible for keeping track of the transaction objects themselves. | ||||
* If a result is not present, it means validation was unfinished for that | * If a result is not present, it means validation was unfinished for that | ||||
* transaction. | * transaction. If there was a package-wide error (see result in m_state), | ||||
* m_tx_results will be empty. | |||||
*/ | */ | ||||
std::map<const TxId, const MempoolAcceptResult> m_tx_results; | std::map<const TxId, const MempoolAcceptResult> m_tx_results; | ||||
explicit PackageMempoolAcceptResult( | explicit PackageMempoolAcceptResult( | ||||
PackageValidationState state, | PackageValidationState state, | ||||
std::map<const TxId, const MempoolAcceptResult> &&results) | std::map<const TxId, const MempoolAcceptResult> &&results) | ||||
: m_state{state}, m_tx_results(std::move(results)) {} | : m_state{state}, m_tx_results(std::move(results)) {} | ||||
Show All 21 Lines | |||||
/** | /** | ||||
* Atomically test acceptance of a package. If the package only contains one tx, | * Atomically test acceptance of a package. If the package only contains one tx, | ||||
* package rules still apply. | * package rules still apply. | ||||
* | * | ||||
* @param[in] txns Group of transactions which may be independent or contain | * @param[in] txns Group of transactions which may be independent or contain | ||||
* parent-child dependencies. The transactions must not conflict, with each | * parent-child dependencies. The transactions must not conflict, with each | ||||
* other, i.e. must not spend the same inputs. If any dependencies exist, | * other, i.e. must not spend the same inputs. If any dependencies exist, | ||||
* parents must appear before children. | * parents must appear anywhere in the list before their children. | ||||
* @returns a PackageMempoolAcceptResult which includes a MempoolAcceptResult | * @returns a PackageMempoolAcceptResult which includes a MempoolAcceptResult | ||||
* for each transaction. If a transaction fails, validation will exit early | * for each transaction. If a transaction fails, validation will exit early | ||||
* and some results may be missing. | * and some results may be missing. | ||||
*/ | */ | ||||
PackageMempoolAcceptResult | PackageMempoolAcceptResult | ||||
ProcessNewPackage(const Config &config, CChainState &active_chainstate, | ProcessNewPackage(const Config &config, CChainState &active_chainstate, | ||||
CTxMemPool &pool, const Package &txns, bool test_accept) | CTxMemPool &pool, const Package &txns, bool test_accept) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
▲ Show 20 Lines • Show All 1,064 Lines • Show Last 20 Lines |