38 std::promise<void> promise;
40 uint256 wtxid = tx->GetWitnessHash();
41 bool callback_set =
false;
49 for (
size_t o = 0; o < tx->vout.size(); o++) {
56 if (
auto mempool_tx =
node.mempool->get(txid); mempool_tx) {
64 wtxid = mempool_tx->GetWitnessHash();
74 }
else if (result.
m_base_fees.value() > max_tx_fee) {
90 node.mempool->AddUnbroadcastTx(txid);
113 promise.get_future().wait();
117 node.peerman->RelayTransaction(txid, wtxid);
std::shared_ptr< const CTransaction > CTransactionRef
bool IsSpent() const
Either this coin never existed (see e.g.
const Coin & AccessCoin(const COutPoint &output) const
Return a reference to Coin in the cache, or coinEmpty if not found.
MempoolAcceptResult AcceptToMemoryPool(CChainState &active_chainstate, CTxMemPool &pool, const CTransactionRef &tx, bool bypass_limits, bool test_accept)
(Try to) add a transaction to the memory pool.
transaction was missing some of its inputs
const TxValidationState m_state
const std::optional< CAmount > m_base_fees
Raw base fees in satoshis.
const ResultType m_result_type
int64_t CAmount
Amount in satoshis (Can be negative)
NodeContext struct containing references to chain state and connection state.
std::string ToString() const
static TransactionError HandleATMPError(const TxValidationState &state, std::string &err_string_out)
void CallFunctionInValidationInterfaceQueue(std::function< void()> func)
Pushes a function to callback onto the notification queue, guaranteeing any callbacks generated prior...
An outpoint - a combination of a transaction hash and an index n into its vout.
Validation result for a single transaction mempool acceptance.
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate...
TransactionError BroadcastTransaction(NodeContext &node, const CTransactionRef tx, std::string &err_string, const CAmount &max_tx_fee, bool relay, bool wait_callback)
Submit a transaction to the mempool and (optionally) relay it to all P2P peers.
CCoinsView that adds a memory cache for transactions to another CCoinsView.