mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-09 02:59:31 +08:00
remove unused GetDestinationForKey
It is only used in test. There it is problematic, because it sometimes
relies on m_default_address_type. If the default were changed to
BECH32M, those tests would fail the assert(false).
So just use PKHash{} in all tests and remove GetDestinationForKey.
This commit is contained in:
@@ -37,7 +37,7 @@ static void WalletMigration(benchmark::Bench& bench)
|
||||
for (int w = 0; w < NUM_WATCH_ONLY_ADDR; ++w) {
|
||||
CKey key = GenerateRandomKey();
|
||||
LOCK(wallet->cs_wallet);
|
||||
const auto& dest = GetDestinationForKey(key.GetPubKey(), OutputType::LEGACY);
|
||||
const PKHash dest{key.GetPubKey()};
|
||||
const CScript& script = scripts_watch_only.emplace_back(GetScriptForDestination(dest));
|
||||
assert(legacy_spkm->LoadWatchOnly(script));
|
||||
assert(wallet->SetAddressBook(dest, strprintf("watch_%d", w), /*purpose=*/std::nullopt));
|
||||
|
||||
Reference in New Issue
Block a user