@@ -21,6 +21,7 @@ using wallet::DatabaseOptions;
21
21
using wallet::DatabaseStatus;
22
22
using wallet::ISMINE_SPENDABLE;
23
23
using wallet::MakeWalletDatabase;
24
+ using wallet::TxStateInactive;
24
25
using wallet::WALLET_FLAG_DESCRIPTORS;
25
26
using wallet::WalletContext;
26
27
@@ -46,6 +47,19 @@ static void BenchUnloadWallet(std::shared_ptr<CWallet>&& wallet)
46
47
UnloadWallet (std::move (wallet));
47
48
}
48
49
50
+ static void AddTx (CWallet& wallet)
51
+ {
52
+ bilingual_str error;
53
+ CTxDestination dest;
54
+ wallet.GetNewDestination (OutputType::BECH32, " " , dest, error);
55
+
56
+ CMutableTransaction mtx;
57
+ mtx.vout .push_back ({COIN, GetScriptForDestination (dest)});
58
+ mtx.vin .push_back (CTxIn ());
59
+
60
+ wallet.AddToWallet (MakeTransactionRef (mtx), TxStateInactive{});
61
+ }
62
+
49
63
static void WalletLoading (benchmark::Bench& bench, bool legacy_wallet)
50
64
{
51
65
const auto test_setup = MakeNoLogFileContext<TestingSetup>();
@@ -63,7 +77,7 @@ static void WalletLoading(benchmark::Bench& bench, bool legacy_wallet)
63
77
64
78
// Generate a bunch of transactions and addresses to put into the wallet
65
79
for (int i = 0 ; i < 5000 ; ++i) {
66
- generatetoaddress (test_setup-> m_node , getnewaddress ( *wallet) );
80
+ AddTx ( *wallet);
67
81
}
68
82
69
83
// reload the wallet for the actual benchmark
0 commit comments