51 TxId txid = tx->GetId();
60 for (
size_t o = 0;
o < tx->vout.size();
o++) {
70 if (!
node.mempool->exists(txid)) {
76 node.chainman->ProcessTransaction(tx,
true);
86 node.chainman->ProcessTransaction(tx,
false);
97 node.mempool->AddUnbroadcastTx(txid);
123 node.peerman->RelayTransaction(txid);
142 if (
g_txindex->FindTx(txid, block_hash, tx)) {
148 hashBlock = block_hash;
156 for (
const auto &tx : block.
vtx) {
157 if (tx->GetId() == txid) {
std::vector< CTransactionRef > vtx
The block chain is a tree shaped structure starting with the genesis block at the root,...
CCoinsView that adds a memory cache for transactions to another CCoinsView.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
CTransactionRef get(const TxId &txid) const
std::string ToString() const
Maintains a tree of blocks (stored in m_block_index) which is consulted to determine where the most-w...
@ TX_MISSING_INPUTS
transaction was missing some of its inputs
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
TransactionError BroadcastTransaction(const NodeContext &node, const CTransactionRef tx, std::string &err_string, const Amount max_tx_fee, bool relay, bool wait_callback)
Submit a transaction to the mempool and (optionally) relay it to all P2P peers.
CTransactionRef GetTransaction(const CBlockIndex *const block_index, const CTxMemPool *const mempool, const TxId &txid, BlockHash &hashBlock, const BlockManager &blockman)
Return transaction with a given txid.
static TransactionError HandleATMPError(const TxValidationState &state, std::string &err_string_out)
std::shared_ptr< const CTransaction > CTransactionRef
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
static constexpr Amount zero() noexcept
A BlockHash is a unqiue identifier for a block.
Validation result for a transaction evaluated by MemPoolAccept (single or package).
const ResultType m_result_type
Result type.
const TxValidationState m_state
Contains information about why the transaction failed.
@ VALID
Fully validated, valid.
const std::optional< Amount > m_base_fees
Raw base fees in satoshis.
A TxId is the identifier of a transaction.
NodeContext struct containing references to chain state and connection state.
std::unique_ptr< TxIndex > g_txindex
The global transaction index, used in GetTransaction. May be null.
void CallFunctionInValidationInterfaceQueue(std::function< void()> func)
Pushes a function to callback onto the notification queue, guaranteeing any callbacks generated prior...