aboutsummaryrefslogtreecommitdiff
path: root/src/test/util/wallet.cpp
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2022-08-03 14:59:55 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2022-10-26 15:54:31 -0300
commit3fcb545ab26be3e785b5e5654be0bdc77099d827 (patch)
treeb6e5d4e817e08fbf941ecc4c20fb1b96526ddd9b /src/test/util/wallet.cpp
parenta8a75346d7e7247596c8a580d65ceaad49c97b97 (diff)
downloadbitcoin-3fcb545ab26be3e785b5e5654be0bdc77099d827.tar.xz
bench: benchmark transaction creation process
Goal 1: Benchmark the transaction creation process for pre-selected-inputs only. Setting `m_allow_other_inputs=false` to disallow the wallet to include coins automatically. Goal 2: Benchmark the transaction creation process for pre-selected-inputs and coin selection. ----------------------- Benchmark Setup: 1) Generates a 5k blockchain, loading the wallet with 5k transactions with two outputs each. 2) Fetch 4 random UTXO from the wallet's available coins and pre-select them as inputs inside CoinControl. Benchmark (Goal 1): Call `CreateTransaction` providing the coin control, who has set `m_allow_other_inputs=false` and the manually selected coins. Benchmark (Goal 2): Call `CreateTransaction` providing the coin control, who has set `m_allow_other_inputs=true` and the manually selected coins.
Diffstat (limited to 'src/test/util/wallet.cpp')
-rw-r--r--src/test/util/wallet.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/util/wallet.cpp b/src/test/util/wallet.cpp
index b54774cbb9..2dadffafb4 100644
--- a/src/test/util/wallet.cpp
+++ b/src/test/util/wallet.cpp
@@ -21,7 +21,12 @@ const std::string ADDRESS_BCRT1_UNSPENDABLE = "bcrt1qqqqqqqqqqqqqqqqqqqqqqqqqqqq
std::string getnewaddress(CWallet& w)
{
constexpr auto output_type = OutputType::BECH32;
- return EncodeDestination(*Assert(w.GetNewDestination(output_type, "")));
+ return EncodeDestination(getNewDestination(w, output_type));
+}
+
+CTxDestination getNewDestination(CWallet& w, OutputType output_type)
+{
+ return *Assert(w.GetNewDestination(output_type, ""));
}
#endif // ENABLE_WALLET