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:
MarcoFalke
2025-05-15 14:32:58 +02:00
parent fac72fef27
commit fafee85358
6 changed files with 7 additions and 36 deletions

View File

@@ -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));