mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
rpc: Use mempool from node context instead of global
Currently they are identical, but in the future we might want to turn the mempool into a unique_ptr. Replacing the global with the mempool pointer from the node context simplifies this step.
This commit is contained in:
@@ -636,6 +636,7 @@ static UniValue combinerawtransaction(const JSONRPCRequest& request)
|
||||
CCoinsView viewDummy;
|
||||
CCoinsViewCache view(&viewDummy);
|
||||
{
|
||||
const CTxMemPool& mempool = EnsureMemPool();
|
||||
LOCK(cs_main);
|
||||
LOCK(mempool.cs);
|
||||
CCoinsViewCache &viewChain = ::ChainstateActive().CoinsTip();
|
||||
@@ -888,6 +889,7 @@ static UniValue testmempoolaccept(const JSONRPCRequest& request)
|
||||
max_raw_tx_fee_rate = CFeeRate(AmountFromValue(request.params[1]));
|
||||
}
|
||||
|
||||
CTxMemPool& mempool = EnsureMemPool();
|
||||
int64_t virtual_size = GetVirtualTransactionSize(*tx);
|
||||
CAmount max_raw_tx_fee = max_raw_tx_fee_rate.GetFee(virtual_size);
|
||||
|
||||
@@ -1506,6 +1508,7 @@ UniValue utxoupdatepsbt(const JSONRPCRequest& request)
|
||||
CCoinsView viewDummy;
|
||||
CCoinsViewCache view(&viewDummy);
|
||||
{
|
||||
const CTxMemPool& mempool = EnsureMemPool();
|
||||
LOCK2(cs_main, mempool.cs);
|
||||
CCoinsViewCache &viewChain = ::ChainstateActive().CoinsTip();
|
||||
CCoinsViewMemPool viewMempool(&viewChain, mempool);
|
||||
|
||||
Reference in New Issue
Block a user