wallet: remove unused DescriptorScriptPubKeyMan::AddDescriptorKey

The private method has no callers. It opened a `WalletBatch` and
forwarded to `AddDescriptorKeyWithDB`, which is still called from two
other places.

Its last caller, in `CWallet::AddWalletDescriptor`, was replaced in
aa4f7823aa ("wallet: include keys when constructing DescriptorSPKM
during import"), which builds the manager with `CreateFromMigration`
instead of adding the key afterwards.
This commit is contained in:
jeanpablo
2026-08-30 15:39:01 +01:00
parent d2e24e951d
commit a0e9aac428
2 changed files with 0 additions and 10 deletions

View File

@@ -1173,15 +1173,6 @@ std::vector<WalletDestination> DescriptorScriptPubKeyMan::MarkUnusedAddresses(co
return result;
}
void DescriptorScriptPubKeyMan::AddDescriptorKey(const CKey& key, const CPubKey &pubkey)
{
LOCK(cs_desc_man);
WalletBatch batch(m_storage.GetDatabase());
if (!AddDescriptorKeyWithDB(batch, key, pubkey)) {
throw std::runtime_error(std::string(__func__) + ": writing descriptor private key failed");
}
}
bool DescriptorScriptPubKeyMan::AddDescriptorKeyWithDB(WalletBatch& batch, const CKey& key, const CPubKey &pubkey)
{
AssertLockHeld(cs_desc_man);

View File

@@ -321,7 +321,6 @@ private:
void Load();
void AddDescriptorKey(const CKey& key, const CPubKey &pubkey);
void UpdateWithSigningProvider(WalletBatch& batch, const FlatSigningProvider& signing_provider) EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man);
//! Setup descriptors based on the given CExtKey