@@ -39,9 +39,10 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
39
39
40
40
{ // cs_main scope
41
41
LOCK (cs_main);
42
+ assert (std::addressof (::ChainstateActive ()) == std::addressof (node.chainman ->ActiveChainstate ()));
42
43
// If the transaction is already confirmed in the chain, don't do anything
43
44
// and return early.
44
- CCoinsViewCache &view = :: ChainstateActive ().CoinsTip ();
45
+ CCoinsViewCache &view = node. chainman -> ActiveChainstate ().CoinsTip ();
45
46
for (size_t o = 0 ; o < tx->vout .size (); o++) {
46
47
const Coin& existingCoin = view.AccessCoin (COutPoint (hashTx, o));
47
48
// 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
53
54
if (max_tx_fee > 0 ) {
54
55
// First, call ATMP with test_accept and check the fee. If ATMP
55
56
// 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 */ ,
57
58
true /* test_accept */ );
58
59
if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) {
59
60
return HandleATMPError (result.m_state , err_string);
@@ -62,7 +63,7 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
62
63
}
63
64
}
64
65
// 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 */ ,
66
67
false /* test_accept */ );
67
68
if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) {
68
69
return HandleATMPError (result.m_state , err_string);
0 commit comments