Changeset View
Changeset View
Standalone View
Standalone View
src/bench/wallet_balance.cpp
Show All 18 Lines | static void WalletBalance(benchmark::State &state, const bool set_dirty, | ||||
const Config &config = GetConfig(); | const Config &config = GetConfig(); | ||||
NodeContext node; | NodeContext node; | ||||
std::unique_ptr<interfaces::Chain> chain = | std::unique_ptr<interfaces::Chain> chain = | ||||
interfaces::MakeChain(node, config.GetChainParams()); | interfaces::MakeChain(node, config.GetChainParams()); | ||||
CWallet wallet{config.GetChainParams(), chain.get(), WalletLocation(), | CWallet wallet{config.GetChainParams(), chain.get(), WalletLocation(), | ||||
WalletDatabase::CreateMock()}; | WalletDatabase::CreateMock()}; | ||||
{ | { | ||||
wallet.SetupLegacyScriptPubKeyMan(); | |||||
bool first_run; | bool first_run; | ||||
if (wallet.LoadWallet(first_run) != DBErrors::LOAD_OK) { | if (wallet.LoadWallet(first_run) != DBErrors::LOAD_OK) { | ||||
assert(false); | assert(false); | ||||
} | } | ||||
} | } | ||||
auto handler = chain->handleNotifications({&wallet, [](CWallet *) {}}); | auto handler = chain->handleNotifications({&wallet, [](CWallet *) {}}); | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |