Merge bitcoin/bitcoin#35924: Wallet, refactor: Remove orphaned EraseWatchOnly function
What changed, and why it matters
This commit removes an unused function called EraseWatchOnly from the Bitcoin Core wallet code. It is a routine cleanup with no functional change and no security relevance.
No action needed. This is a benign code-cleanup refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit deletes the WalletBatch::EraseWatchOnly method and its declaration. The function had no remaining callers after a prior refactor (PR #28710), so this change only removes dead code. There is no logic change, no bug fix, and no security behavior alteration.
Changed components
src/wallet/walletdb.cppsrc/wallet/walletdb.hInspect captured patch +0 / −9
### src/wallet/walletdb.cpp
@@ -179,14 +179,6 @@ bool WalletBatch::WriteWatchOnly(const CScript &dest, const CKeyMetadata& keyMet
return WriteIC(std::make_pair(DBKeys::WATCHS, dest), uint8_t{'1'});
}
-bool WalletBatch::EraseWatchOnly(const CScript &dest)
-{
- if (!EraseIC(std::make_pair(DBKeys::WATCHMETA, dest))) {
- return false;
- }
- return EraseIC(std::make_pair(DBKeys::WATCHS, dest));
-}
-
bool WalletBatch::WriteBestBlock(const CBlockLocator& locator)
{
WriteIC(DBKeys::BESTBLOCK, CBlockLocator()); // Write empty block locator so versions that require a merkle branch automatically rescan
### src/wallet/walletdb.h
@@ -241,7 +241,6 @@ class WalletBatch
bool EraseMasterKey(unsigned int id);
bool WriteWatchOnly(const CScript &script, const CKeyMetadata &keymeta);
- bool EraseWatchOnly(const CScript &script);
bool WriteBestBlock(const CBlockLocator& locator);
bool ReadBestBlock(CBlockLocator& locator);Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.