From fa660d65d7cc401ad5bbfdc076a074de19a79329 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 22 Nov 2019 16:24:38 -0500 Subject: node: Use mempool from node context instead of global --- src/node/coin.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/node/coin.cpp') diff --git a/src/node/coin.cpp b/src/node/coin.cpp index ad8d1d3af..f4f86cdbe 100644 --- a/src/node/coin.cpp +++ b/src/node/coin.cpp @@ -4,14 +4,16 @@ #include +#include #include #include -void FindCoins(std::map& coins) +void FindCoins(const NodeContext& node, std::map& coins) { - LOCK2(cs_main, ::mempool.cs); + assert(node.mempool); + LOCK2(cs_main, node.mempool->cs); CCoinsViewCache& chain_view = ::ChainstateActive().CoinsTip(); - CCoinsViewMemPool mempool_view(&chain_view, ::mempool); + CCoinsViewMemPool mempool_view(&chain_view, *node.mempool); for (auto& coin : coins) { if (!mempool_view.GetCoin(coin.first, coin.second)) { // Either the coin is not in the CCoinsViewCache or is spent. Clear it. -- cgit v1.2.3