wallet: improve `{LoadActive,Deactivate}ScriptPubKeyMan` log #25790

pull w0xlt wants to merge 1 commits into bitcoin:master from w0xlt:log_load_active_script_pubkeyman changing 1 files +2 −2
  1. w0xlt commented at 7:45 PM on August 5, 2022: contributor

    This PR includes the output type description in the log. It currently shows the enum position, which is only useful if the reader knows the code.

    Master:

    Setting spkMan to active: id = 9f..04, type = 3, internal = 0
    Setting spkMan to active: id = 3d..21, type = 2, internal = 0
    Setting spkMan to active: id = 69..d4, type = 0, internal = 1
    Setting spkMan to active: id = 97..ea, type = 1, internal = 1
    

    PR:

    Setting spkMan to active: id = 6a..4f, type = bech32m, internal = false
    Setting spkMan to active: id = 83..dc, type = legacy, internal = true
    Setting spkMan to active: id = 7e..5d, type = p2sh-segwit, internal = true
    Setting spkMan to active: id = bd..d2, type = bech32, internal = true
    Setting spkMan to active: id = 13...7c, type = bech32m, internal = true
    
    
  2. fanquake added the label Wallet on Aug 5, 2022
  3. theStack commented at 8:04 PM on August 5, 2022: contributor

    Concept ACK

  4. wallet: improve `{LoadActive,Deactivate}ScriptPubKeyMan` log b5a762a353
  5. in src/wallet/wallet.cpp:3479 in 78914c2bad outdated
    3475 | @@ -3476,7 +3476,7 @@ void CWallet::LoadActiveScriptPubKeyMan(uint256 id, OutputType type, bool intern
    3476 |      // Legacy wallets have only one ScriptPubKeyManager and it's active for all output and change types.
    3477 |      Assert(IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS));
    3478 |  
    3479 | -    WalletLogPrintf("Setting spkMan to active: id = %s, type = %d, internal = %d\n", id.ToString(), static_cast<int>(type), static_cast<int>(internal));
    3480 | +    WalletLogPrintf("Setting spkMan to active: id = %s, type = %d, internal = %d\n", id.ToString(), FormatOutputType(type), internal ? "true" : "false");
    


    achow101 commented at 8:07 PM on August 5, 2022:

    %d should be changed to %s?


    w0xlt commented at 8:20 PM on August 5, 2022:

    Done in b5a762a35368ad5ab07018e5da14229291a54b94

  6. w0xlt force-pushed on Aug 5, 2022
  7. theStack commented at 11:09 AM on August 6, 2022: contributor

    Master:

    Setting spkMan to active: id = 9f..04, type = 3, internal = 0
    Setting spkMan to active: id = 3d..21, type = 4, internal = 0
    Setting spkMan to active: id = 69..d4, type = 0, internal = 1
    Setting spkMan to active: id = 97..ea, type = 1, internal = 1
    

    How could type ever be 4 in master, considering that the OutputType enum class only contains four elements, i.e. has a range of 0-3?

  8. w0xlt commented at 3:04 PM on August 6, 2022: contributor

    @theStack you are right. In master, the range is 0-3. I got that log from another development branch and thought it was from the master. I changed the PR description.

  9. theStack approved
  10. theStack commented at 8:40 PM on August 6, 2022: contributor

    Code-review ACK b5a762a35368ad5ab07018e5da14229291a54b94

  11. S3RK commented at 7:24 AM on August 8, 2022: contributor

    Code review ACK b5a762a35368ad5ab07018e5da14229291a54b94

  12. fanquake requested review from achow101 on Aug 8, 2022
  13. achow101 commented at 3:07 PM on August 8, 2022: member

    ACK b5a762a35368ad5ab07018e5da14229291a54b94

  14. achow101 merged this on Aug 8, 2022
  15. achow101 closed this on Aug 8, 2022

  16. sidhujag referenced this in commit b78d135525 on Aug 8, 2022
  17. w0xlt deleted the branch on Aug 10, 2022
  18. bitcoin locked this on Aug 10, 2023


achow101

Labels

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-21 00:13 UTC

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