wallet: Change ScriptPubKeyMan::Upgrade default to True #22461

pull achow101 wants to merge 2 commits into bitcoin:master from achow101:implement-desc-upgrade changing 2 files +9 −3
  1. achow101 commented at 4:52 PM on July 15, 2021: member

    When adding a new ScriptPubKeyMan, it's likely that there will be nothing for Upgrade to do. If it is called (via upgradewallet), then it should do nothing, successfully. This PR changes the default ScriptPubKeyMan::Upgrade function so that it returns a success instead of failure when doing nothing.

    Fixes #22460

  2. Change ScriptPubKeyMan::Upgrade to default to return true
    If a ScriptPubKeyMan does not implement Upgrade, then using upgraewallet
    will fail unexpectedly. By changing the default to return true, then
    this error can be avoided. This is still correct because a successful
    upgrade can be that nothing happened.
    48bd7d3b77
  3. MarcoFalke added this to the milestone 22.0 on Jul 15, 2021
  4. DrahtBot added the label Wallet on Jul 15, 2021
  5. GeneFerneau commented at 6:43 PM on July 15, 2021: none

    Concept + review ACK 4ff4dc0

  6. Test that descriptor wallet upgrade does nothing 5012a7912e
  7. in test/functional/wallet_upgradewallet.py:357 in 4ff4dc0699 outdated
     352 | @@ -352,6 +353,11 @@ def copy_split_hd():
     353 |          v16_3_kvs = dump_bdb_kv(v16_3_wallet)
     354 |          assert b'\x0adefaultkey' not in v16_3_kvs
     355 |  
     356 | +        if self.is_sqlite_compiled():
     357 | +            self.log.info("Checking that descriptor wallet do nothing, successfully")
    


    meshcollider commented at 7:06 PM on July 16, 2021:

    Nit: "descriptor wallet do nothing"


    achow101 commented at 7:35 PM on July 16, 2021:

    Fixed


    jonatack commented at 7:46 PM on July 16, 2021:

    Doing nothing successfully sounds very nice :)

  8. achow101 force-pushed on Jul 16, 2021
  9. jonatack commented at 7:45 PM on July 16, 2021: member

    ACK 5012a7912ee9fa35bc417cb073eebffd85f36c6c

  10. meshcollider commented at 5:35 AM on July 18, 2021: contributor

    utACK 5012a7912ee9fa35bc417cb073eebffd85f36c6c

  11. meshcollider merged this on Jul 18, 2021
  12. meshcollider closed this on Jul 18, 2021

  13. sidhujag referenced this in commit 8385bc31de on Jul 23, 2021
  14. gwillen referenced this in commit 42343f2fdc on Jun 1, 2022
  15. DrahtBot locked this on Aug 18, 2022

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-04-19 00:14 UTC

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