 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
25 const auto test_setup = MakeNoLogFileContext<const TestingSetup>();
33 wallet.SetupDescriptorScriptPubKeyMans();
34 if (
wallet.LoadWallet() != DBErrors::LOAD_OK)
assert(
false);
38 const std::optional<std::string> address_mine{add_mine ? std::optional<std::string>{
getnewaddress(
wallet)} : std::nullopt};
40 for (
int i = 0; i < 100; ++i) {
49 if (set_dirty)
wallet.MarkDirty();
51 if (add_mine)
assert(bal.m_mine_trusted > 0);
const std::string ADDRESS_BCRT1_UNSPENDABLE
static void WalletBalanceClean(benchmark::Bench &bench)
static void WalletBalanceMine(benchmark::Bench &bench)
bool(* handler)(const std::any &context, HTTPRequest *req, const std::string &strReq)
static void WalletBalanceWatch(benchmark::Bench &bench)
@ WALLET_FLAG_DESCRIPTORS
Indicate that this wallet supports DescriptorScriptPubKeyMan.
Main entry point to nanobench's benchmarking facility.
DBErrors
Error statuses for the wallet database.
std::shared_ptr< CWallet > wallet
void SyncWithValidationInterfaceQueue()
This is a synonym for the following, which asserts certain locks are not held: std::promise<void> pro...
std::string getnewaddress(wallet::CWallet &w)
Returns a new address from the wallet.
static void WalletBalance(benchmark::Bench &bench, const bool set_dirty, const bool add_mine)
BENCHMARK(WalletBalanceDirty)
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
std::unique_ptr< WalletDatabase > CreateMockWalletDatabase()
Return object for accessing temporary in-memory database.
static RPCHelpMan generatetoaddress()
static void WalletBalanceDirty(benchmark::Bench &bench)
Balance GetBalance(const CWallet &wallet, const int min_depth, bool avoid_reuse)