Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show First 20 Lines • Show All 323 Lines • ▼ Show 20 Lines | struct PackageMempoolAcceptResult { | ||||
* MempoolAcceptResult | * MempoolAcceptResult | ||||
*/ | */ | ||||
explicit PackageMempoolAcceptResult(const TxId &txid, | explicit PackageMempoolAcceptResult(const TxId &txid, | ||||
const MempoolAcceptResult &result) | const MempoolAcceptResult &result) | ||||
: m_tx_results{{txid, result}} {} | : m_tx_results{{txid, result}} {} | ||||
}; | }; | ||||
/** | /** | ||||
* (try to) add transaction to memory pool | * Try to add a transaction to the mempool. This is an internal function and is | ||||
* exposed only for testing. Client code should use | |||||
* ChainstateManager::ProcessTransaction() | |||||
* | |||||
* @param[in] active_chainstate Reference to the active chainstate. | |||||
* @param[in] pool Reference to the node's mempool. | |||||
* @param[in] config The global configuration. | |||||
* @param[in] tx The transaction to submit for mempool | |||||
* acceptance. | |||||
* @param[in] bypass_limits When true, don't enforce mempool fee and | |||||
* capacity limits. | |||||
* @param[in] test_accept When true, run validation checks but don't | |||||
* submit to mempool. | |||||
* | * | ||||
* @param[in] bypass_limits When true, don't enforce mempool fee limits. | * @returns a MempoolAcceptResult indicating whether the transaction was | ||||
* @param[in] test_accept When true, run validation checks but don't submit | * accepted/rejected with reason. | ||||
* to mempool. | |||||
*/ | */ | ||||
MempoolAcceptResult | MempoolAcceptResult | ||||
AcceptToMemoryPool(CChainState &active_chainstate, const Config &config, | AcceptToMemoryPool(CChainState &active_chainstate, const Config &config, | ||||
CTxMemPool &pool, const CTransactionRef &tx, | CTxMemPool &pool, const CTransactionRef &tx, | ||||
bool bypass_limits, bool test_accept = false) | bool bypass_limits, bool test_accept = false) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 1,029 Lines • ▼ Show 20 Lines | public: | ||||
* @return True if block headers were accepted as valid. | * @return True if block headers were accepted as valid. | ||||
*/ | */ | ||||
bool ProcessNewBlockHeaders(const Config &config, | bool ProcessNewBlockHeaders(const Config &config, | ||||
const std::vector<CBlockHeader> &block, | const std::vector<CBlockHeader> &block, | ||||
BlockValidationState &state, | BlockValidationState &state, | ||||
const CBlockIndex **ppindex = nullptr) | const CBlockIndex **ppindex = nullptr) | ||||
LOCKS_EXCLUDED(cs_main); | LOCKS_EXCLUDED(cs_main); | ||||
/** | |||||
* Try to add a transaction to the memory pool. | |||||
* | |||||
* @param[in] tx The transaction to submit for mempool | |||||
* acceptance. | |||||
* @param[in] test_accept When true, run validation checks but don't | |||||
* submit to mempool. | |||||
*/ | |||||
[[nodiscard]] MempoolAcceptResult | |||||
ProcessTransaction(const CTransactionRef &tx, bool test_accept = false) | |||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | |||||
//! Load the block tree and coins database from disk, initializing state if | //! Load the block tree and coins database from disk, initializing state if | ||||
//! we're running with -reindex | //! we're running with -reindex | ||||
bool LoadBlockIndex() EXCLUSIVE_LOCKS_REQUIRED(cs_main); | bool LoadBlockIndex() EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
//! Unload block index and chain data before shutdown. | //! Unload block index and chain data before shutdown. | ||||
void Unload() EXCLUSIVE_LOCKS_REQUIRED(::cs_main); | void Unload() EXCLUSIVE_LOCKS_REQUIRED(::cs_main); | ||||
//! Clear (deconstruct) chainstate data. | //! Clear (deconstruct) chainstate data. | ||||
Show All 36 Lines |