36 std::promise<void> promise;
38 bool callback_set =
false;
45 for (
size_t o = 0; o < tx->vout.size(); o++) {
51 if (!node.
mempool->exists(hashTx)) {
59 nullptr ,
false ,
true, &fee)) {
61 }
else if (fee > max_tx_fee) {
94 promise.get_future().wait();
100 node.
mempool->AddUnbroadcastTx(hashTx);
std::shared_ptr< const CTransaction > CTransactionRef
std::unique_ptr< CTxMemPool > mempool
transaction was missing some of its inputs
int64_t CAmount
Amount in satoshis (Can be negative)
bool AcceptToMemoryPool(CTxMemPool &pool, TxValidationState &state, const CTransactionRef &tx, std::list< CTransactionRef > *plTxnReplaced, bool bypass_limits, bool test_accept, CAmount *fee_out)
(try to) add transaction to memory pool plTxnReplaced will be appended to with all transactions repla...
NodeContext struct containing references to chain state and connection state.
std::unique_ptr< CConnman > connman
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate...
static TransactionError HandleATMPError(const TxValidationState &state, std::string &err_string_out)
const Coin & AccessCoin(const COutPoint &output) const
Return a reference to Coin in the cache, or coinEmpty if not found.
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.
void RelayTransaction(const uint256 &txid, const uint256 &wtxid, const CConnman &connman) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Relay transaction to every node.
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.
CChainState & ChainstateActive()
Please prefer the identical ChainstateManager::ActiveChainstate.
std::string ToString() const
CCoinsViewCache & CoinsTip() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
CCoinsView that adds a memory cache for transactions to another CCoinsView.