aboutsummaryrefslogtreecommitdiff
path: root/src/node/transaction.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-11-22 16:24:38 -0500
committerMarcoFalke <falke.marco@gmail.com>2019-12-05 14:22:05 -0500
commitfa660d65d7cc401ad5bbfdc076a074de19a79329 (patch)
treee66d5323bd671bbfdec809b28775d8bf5d56ba8f /src/node/transaction.cpp
parentfacbaf092f1ab298943206603cff6e6e3d30d452 (diff)
downloadbitcoin-fa660d65d7cc401ad5bbfdc076a074de19a79329.tar.xz
node: Use mempool from node context instead of global
Diffstat (limited to 'src/node/transaction.cpp')
-rw-r--r--src/node/transaction.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp
index 3c0df2b26e..5e2e502015 100644
--- a/src/node/transaction.cpp
+++ b/src/node/transaction.cpp
@@ -20,6 +20,7 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
// node.connman is assigned both before chain clients and before RPC server is accepting calls,
// and reset after chain clients and RPC sever are stopped. node.connman should never be null here.
assert(node.connman);
+ assert(node.mempool);
std::promise<void> promise;
uint256 hashTx = tx->GetHash();
bool callback_set = false;
@@ -35,10 +36,10 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
// So if the output does exist, then this transaction exists in the chain.
if (!existingCoin.IsSpent()) return TransactionError::ALREADY_IN_CHAIN;
}
- if (!mempool.exists(hashTx)) {
+ if (!node.mempool->exists(hashTx)) {
// Transaction is not already in the mempool. Submit it.
TxValidationState state;
- if (!AcceptToMemoryPool(mempool, state, std::move(tx),
+ if (!AcceptToMemoryPool(*node.mempool, state, std::move(tx),
nullptr /* plTxnReplaced */, false /* bypass_limits */, max_tx_fee)) {
err_string = FormatStateMessage(state);
if (state.IsInvalid()) {