@@ -39,9 +39,10 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
3939
4040 { // cs_main scope
4141 LOCK (cs_main);
42+ assert (std::addressof (::ChainstateActive ()) == std::addressof (node.chainman ->ActiveChainstate ()));
4243 // If the transaction is already confirmed in the chain, don't do anything
4344 // and return early.
44- CCoinsViewCache &view = :: ChainstateActive ().CoinsTip ();
45+ CCoinsViewCache &view = node. chainman -> ActiveChainstate ().CoinsTip ();
4546 for (size_t o = 0 ; o < tx->vout .size (); o++) {
4647 const Coin& existingCoin = view.AccessCoin (COutPoint (hashTx, o));
4748 // IsSpent doesn't mean the coin is spent, it means the output doesn't exist.
@@ -53,7 +54,7 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
5354 if (max_tx_fee > 0 ) {
5455 // First, call ATMP with test_accept and check the fee. If ATMP
5556 // fails here, return error immediately.
56- const MempoolAcceptResult result = AcceptToMemoryPool (:: ChainstateActive (), *node.mempool , tx, false /* bypass_limits */ ,
57+ const MempoolAcceptResult result = AcceptToMemoryPool (node. chainman -> ActiveChainstate (), *node.mempool , tx, false /* bypass_limits */ ,
5758 true /* test_accept */ );
5859 if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) {
5960 return HandleATMPError (result.m_state , err_string);
@@ -62,7 +63,7 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
6263 }
6364 }
6465 // Try to submit the transaction to the mempool.
65- const MempoolAcceptResult result = AcceptToMemoryPool (:: ChainstateActive (), *node.mempool , tx, false /* bypass_limits */ ,
66+ const MempoolAcceptResult result = AcceptToMemoryPool (node. chainman -> ActiveChainstate (), *node.mempool , tx, false /* bypass_limits */ ,
6667 false /* test_accept */ );
6768 if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) {
6869 return HandleATMPError (result.m_state , err_string);
0 commit comments