mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-26 15:36:19 +01:00
bench: Use DescriptorScriptPubKeyMan for wallet things
For wallet related benchmarks that need a ScriptPubKeyMan for operation, use a DescriptorScriptPubKeyMan
This commit is contained in:
@@ -25,16 +25,4 @@ std::string getnewaddress(CWallet& w)
|
||||
return EncodeDestination(dest);
|
||||
}
|
||||
|
||||
void importaddress(CWallet& wallet, const std::string& address)
|
||||
{
|
||||
auto spk_man = wallet.GetLegacyScriptPubKeyMan();
|
||||
LOCK2(wallet.cs_wallet, spk_man->cs_KeyStore);
|
||||
const auto dest = DecodeDestination(address);
|
||||
assert(IsValidDestination(dest));
|
||||
const auto script = GetScriptForDestination(dest);
|
||||
wallet.MarkDirty();
|
||||
assert(!spk_man->HaveWatchOnly(script));
|
||||
if (!spk_man->AddWatchOnly(script, 0 /* nCreateTime */)) assert(false);
|
||||
wallet.SetAddressBook(dest, /* label */ "", "receive");
|
||||
}
|
||||
#endif // ENABLE_WALLET
|
||||
|
||||
Reference in New Issue
Block a user