bugfix: Mark CNoDestination and PubKeyDestination constructor explicit

This should fix the bug reported in
https://github.com/bitcoin/bitcoin/pull/28246#discussion_r1371640502,
which caused the GUI to not detect the destination type of recipients,
thus picking the wrong change destination type.

Also, add missing lifetimebound attribute to a getter method.

GitHub-Pull: #28728
Rebased-From: 1111475b41
This commit is contained in:
MarcoFalke
2023-10-25 12:13:44 +02:00
committed by fanquake
parent 7d0e5b099c
commit 6544ffa01f
5 changed files with 12 additions and 11 deletions

View File

@@ -94,13 +94,14 @@ static void WalletCreateTx(benchmark::Bench& bench, const OutputType output_type
}
// Generate destinations
CScript dest = GetScriptForDestination(getNewDestination(wallet, output_type));
const auto dest{getNewDestination(wallet, output_type)};
// Generate chain; each coinbase will have two outputs to fill-up the wallet
const auto& params = Params();
const CScript coinbase_out{GetScriptForDestination(dest)};
unsigned int chain_size = 5000; // 5k blocks means 10k UTXO for the wallet (minus 200 due COINBASE_MATURITY)
for (unsigned int i = 0; i < chain_size; ++i) {
generateFakeBlock(params, test_setup->m_node, wallet, dest);
generateFakeBlock(params, test_setup->m_node, wallet, coinbase_out);
}
// Check available balance
@@ -185,4 +186,4 @@ static void WalletAvailableCoins(benchmark::Bench& bench) { AvailableCoins(bench
BENCHMARK(WalletCreateTxUseOnlyPresetInputs, benchmark::PriorityLevel::LOW)
BENCHMARK(WalletCreateTxUsePresetInputsAndCoinSelection, benchmark::PriorityLevel::LOW)
BENCHMARK(WalletAvailableCoins, benchmark::PriorityLevel::LOW);
BENCHMARK(WalletAvailableCoins, benchmark::PriorityLevel::LOW);