46 Txid txid = tx->GetHash();
56 for (
size_t o = 0;
o < tx->vout.size();
o++) {
92 node.chainman->ProcessTransaction(tx,
false);
102 node.mempool->AddUnbroadcastTx(txid);
126 node.validation_signals->SyncWithValidationInterfaceQueue();
133 node.peerman->InitiateTxBroadcastToAll(txid,
wtxid);
136 node.peerman->InitiateTxBroadcastPrivate(tx);
152 if (
g_txindex->FindTx(hash, block_hash, tx)) {
157 hashBlock = block_hash;
165 for (
const auto& tx : block.
vtx) {
166 if (tx->GetHash() == hash) {
int64_t CAmount
Amount in satoshis (Can be negative)
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.
An outpoint - a combination of a transaction hash and an index n into its vout.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
CTransactionRef get(const Txid &hash) 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.
CTransactionRef GetTransaction(const CBlockIndex *const block_index, const CTxMemPool *const mempool, const Txid &hash, const BlockManager &blockman, uint256 &hashBlock)
Return transaction with a given hash.
TxBroadcast
How to broadcast a local transaction.
@ MEMPOOL_AND_BROADCAST_TO_ALL
Add the transaction to the mempool and broadcast to all peers for which tx relay is enabled.
@ MEMPOOL_NO_BROADCAST
Add the transaction to the mempool, but don't broadcast to anybody.
@ NO_MEMPOOL_PRIVATE_BROADCAST
Omit the mempool and directly send the transaction via a few dedicated connections to peers on privac...
TransactionError BroadcastTransaction(NodeContext &node, const CTransactionRef tx, std::string &err_string, const CAmount &max_tx_fee, TxBroadcast broadcast_method, bool wait_callback)
Submit a transaction to the mempool and (optionally) relay it to all P2P peers.
static TransactionError HandleATMPError(const TxValidationState &state, std::string &err_string_out)
is a home for public enum and struct type definitions that are used internally by node code,...
std::shared_ptr< const CTransaction > CTransactionRef
Validation result for a transaction evaluated by MemPoolAccept (single or package).
const ResultType m_result_type
Result type.
const std::optional< CAmount > m_base_fees
Raw base fees in satoshis.
const TxValidationState m_state
Contains information about why the transaction failed.
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.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.