wallet: remove orphaned GetAffectedKeys and LegacyScriptPubKeyMan declarations #35955

pull laxmanacharya8 wants to merge 2 commits into bitcoin:master from laxmanacharya8:remove-orphaned-getaffectedkeys changing 7 files +27 −29
  1. laxmanacharya8 commented at 10:01 AM on August 12, 2026: contributor

    Follow-up to #28710, which removed GetAffectedKeys() and LegacyScriptPubKeyMan but left their declarations behind.

    Remove both orphaned declarations, rename SetupLegacyScriptPubKeyMan() to SetupLegacyDataSPKM(), and update related comments and logging to reflect the minimal LegacyDataSPKM retained for legacy wallet loading and migration.

    Testing

    cmake --build build --target bitcoin_wallet -j 8
    cmake --build build --target test_bitcoin -j 8
    build/bin/test_bitcoin --run_test=scriptpubkeyman_tests,walletdb_tests,wallet_tests --catch_system_errors=no --log_level=error
    
  2. DrahtBot added the label Wallet on Aug 12, 2026
  3. DrahtBot commented at 10:01 AM on August 12, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35955.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK achow101, polespinasa
    Stale ACK shuv-amp, pablomartin4btc

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35733 (sign: Remove FillableSigningProvider by achow101)
    • #34909 (wallet, refactor: modularise wallet by extracting out legacy wallet migration by rkrux)
    • #30343 (wallet, logging: Replace WalletLogPrintf() with LogInfo() by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. polespinasa commented at 12:28 PM on August 12, 2026: member

    ACK 4dcca801f0c48c8ab33235b80b4419aaa7a5627c

    This just removes a left-over

    sliv3r@sliv3r:~/Projectes/BitcoinCore/bitcoin$ git grep GetAffectedKeys
    src/wallet/scriptpubkeyman.h:std::vector<CKeyID> GetAffectedKeys(const CScript& spk, const SigningProvider& provider);
    sliv3r@sliv3r:~/Projectes/BitcoinCore/bitcoin$ 
    
    
  5. shuv-amp commented at 1:39 PM on August 12, 2026: contributor

    ACK 4dcca801f0c48c8ab33235b80b4419aaa7a5627c

  6. pablomartin4btc commented at 4:18 PM on August 12, 2026: member

    ACK 4dcca801f0c48c8ab33235b80b4419aaa7a5627c

    Similar to #35924 (and same source of leftovers from #28710).

    I swept the wallet sources for orphaned symbols following the legacy wallet removal. One is still remaining — class LegacyScriptPubKeyMan — happy to open a follow-up if you'd prefer not to.

    <details> <summary>Symbols verified after [#28710](/bitcoin-bitcoin/28710/)</summary> <br>

    Removed class and forward declarations:

    grep -rn "LegacyScriptPubKeyMan" src/wallet/rpc/   # forward decl still in util.h:24
    grep -rn "CKeyPool" src/wallet/                    # struct removed; no orphans found
    
    

    Removed walletdb functions:

    grep -rn "EraseWatchOnly" src/    # removed by [#35924](/bitcoin-bitcoin/35924/)
    grep -rn "WriteCScript\|ReadPool\|WritePool\|ErasePool\|WriteHDChain" src/wallet/walletdb.h   # no orphans found
    

    Removed declarations in headers: grep -rn "GetAffectedKeys" src/ # removed by this PR

    Removed legacy-only RPCs:

    grep -rn "importprivkey\|importaddress\|importpubkey\|importwallet\|dumpprivkey\|dumpwallet\|importmulti\|newkeypool\|addmultisigaddress" src/wallet/rpc/   # no orphans found
    

    Still remaining:

    src/wallet/rpc/util.h:24: class LegacyScriptPubKeyMan; — forward declaration with no definition and no callers since 83af1a3cca. Several doc comments in scriptpubkeyman.h and wallet.h also name LegacyScriptPubKeyMan perhaps are stale and maybe some should say LegacyDataSPKM.

    </details>

    Please verify if there's something else I could have missed, thanks!

  7. laxmanacharya8 renamed this:
    wallet: remove orphaned GetAffectedKeys declaration
    wallet: remove orphaned GetAffectedKeys and LegacyScriptPubKeyMan declarations
    on Aug 12, 2026
  8. laxmanacharya8 commented at 7:46 PM on August 12, 2026: contributor

    Added a second commit.

  9. DrahtBot added the label Needs rebase on Aug 14, 2026
  10. wallet: remove orphaned GetAffectedKeys declaration
    The definition of GetAffectedKeys() and its only caller were removed in
    83af1a3cca ("wallet: Delete LegacySPKM"), but the declaration in
    scriptpubkeyman.h was left behind. The symbol has had no definition and
    no callers since then, so drop the leftover declaration.
    d194be69d6
  11. wallet: remove remaining LegacyScriptPubKeyMan references
    `LegacyScriptPubKeyMan` was removed in 83af1a3cca. Remove the orphaned
    forward declaration in `wallet/rpc/util.h`, rename
    `CWallet::SetupLegacyScriptPubKeyMan()` to `SetupLegacyDataSPKM()`, and
    update the comments and inactive-HD-chain log message that still use
    the deleted class name.
    
    Co-authored-by: shuv-amp <i@shuvamp.com.np>
    02de12b1e6
  12. laxmanacharya8 force-pushed on Aug 14, 2026
  13. DrahtBot removed the label Needs rebase on Aug 14, 2026
  14. achow101 commented at 10:38 PM on August 17, 2026: member

    ACK 02de12b1e614035a73cbae58250920c843a17196

  15. DrahtBot requested review from polespinasa on Aug 17, 2026
  16. DrahtBot requested review from pablomartin4btc on Aug 17, 2026
  17. polespinasa commented at 7:53 AM on August 18, 2026: member

    ACK 02de12b1e614035a73cbae58250920c843a17196

  18. fanquake merged this on Aug 18, 2026
  19. fanquake closed this on Aug 18, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-21 04:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me