diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2017-05-30 15:55:17 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2018-11-06 11:44:40 -0400 |
commit | 8db11dd0b182a93042899651545cc21b34bf0742 (patch) | |
tree | 8165f7a88f2f56cca4d152c5e4fc0d2e5743bc54 /src/bench | |
parent | 7e2e62cf7c513bd7d8e784069c5534fda1c50c52 (diff) |
Pass chain and client variables where needed
This commit does not change behavior. All it does is pass new function
parameters.
It is easiest to review this change with:
git log -p -n1 -U0 --word-diff-regex=.
Diffstat (limited to 'src/bench')
-rw-r--r-- | src/bench/coin_selection.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bench/coin_selection.cpp b/src/bench/coin_selection.cpp index decdadfb26..8552ed34fd 100644 --- a/src/bench/coin_selection.cpp +++ b/src/bench/coin_selection.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <bench/bench.h> +#include <interfaces/chain.h> #include <wallet/wallet.h> #include <wallet/coinselection.h> @@ -33,7 +34,8 @@ static void addCoin(const CAmount& nValue, const CWallet& wallet, std::vector<Ou // (https://github.com/bitcoin/bitcoin/issues/7883#issuecomment-224807484) static void CoinSelection(benchmark::State& state) { - const CWallet wallet(WalletLocation(), WalletDatabase::CreateDummy()); + auto chain = interfaces::MakeChain(); + const CWallet wallet(*chain, WalletLocation(), WalletDatabase::CreateDummy()); LOCK(wallet.cs_wallet); // Add coins. @@ -57,7 +59,8 @@ static void CoinSelection(benchmark::State& state) } typedef std::set<CInputCoin> CoinSet; -static const CWallet testWallet(WalletLocation(), WalletDatabase::CreateDummy()); +static auto testChain = interfaces::MakeChain(); +static const CWallet testWallet(*testChain, WalletLocation(), WalletDatabase::CreateDummy()); std::vector<std::unique_ptr<CWalletTx>> wtxn; // Copied from src/wallet/test/coinselector_tests.cpp |