Fix misleading RPC console wallet message #695

pull john-moffett wants to merge 1 commits into bitcoin-core:master from john-moffett:2023_01_FixNoWalletRPCConsoleMessage changing 1 files +2 −2
  1. john-moffett commented at 9:11 pm on January 9, 2023: contributor

    Misleading message from RPCConsole window

    In certain circumstances, the GUI console will display the message ‘Executing command without any wallet’ when it is, in fact, using the currently loaded wallet. For instance:

    scr3

    In RPC calls, if no wallet is explicitly selected and there is exactly one wallet loaded, the default is to act on that loaded wallet.

    The GUI console acts that way in reality, but sometimes erroneously reports that it’s not acting on any particular wallet. The root issue is due to the logic that prevents changing the selected wallet if the RPCConsole is visible:

    https://github.com/bitcoin-core/gui/blob/39363a4b945114f5e4718f75098f3036e8fe6a1d/src/qt/rpcconsole.cpp#L783-L786

    This PR removes that unnecessary logic. This does have some ramifications. Prior to this PR, if a user opened the console window without any wallets loaded, then opened two or more wallets, the RPC console would select “None” of the wallets and any wallet-specific RPCs would fail. However, the behavior was different if the user hadn’t had the console window open. In that case, if they opened the RPC Console window after loading at least the first wallet, it would select the first-loaded wallet. This context-dependent behavior is (IMO) undesirable, and this PR changes it to be consistent.

  2. Fix misleading RPC console wallet message
    In certain circumstances, the GUI console will display
    the message 'Executing command without any wallet' when
    it is, in fact, using the default wallet.
    
    In RPC calls, if no wallet is explicitly selected and
    there is exactly one wallet loaded, the default is to
    act on that loaded wallet.
    
    The GUI console acts that way in reality, but
    erroneously reports that it's not acting on any
    particular wallet.
    576f7b8614
  3. DrahtBot commented at 9:11 pm on January 9, 2023: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK hebasto

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. jarolrod added the label Bug on Jan 13, 2023
  5. jarolrod added the label UX on Jan 13, 2023
  6. hebasto commented at 4:04 pm on January 16, 2023: member

    Confirming the bug on Ubuntu 22.04 (Qt 5.15.3).

    Concept ACK.

  7. hebasto renamed this:
    Fix: misleading RPC console wallet message
    Fix misleading RPC console wallet message
    on Jan 16, 2023
  8. hebasto approved
  9. hebasto commented at 4:38 pm on January 16, 2023: member

    ACK 576f7b86147447215566f0b15ef0b56cd1282929, tested on Ubuntu 22.04 (Qt 5.15.3).

    This patch also fixes another buggy behavior for me. Steps to reproduce it on the master branch:

    1. Run bitcoin-qt -nowallet.
    2. Open the “Console” tab of the “Node window”.
    3. Open a wallet.
    4. Run getwalletinfo in the “Console” tab – BUG: No “Executing command using…” message.
    5. Open another wallet.
    6. The wallet selector in the “Console” tab has the “none” value. Not a bug(?), but unexpected behavior (already mentioned in the PR description).
  10. hebasto merged this on Feb 2, 2023
  11. hebasto closed this on Feb 2, 2023

  12. sidhujag referenced this in commit bd8dc70d03 on Feb 3, 2023
  13. bitcoin-core locked this on Feb 2, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 03:20 UTC

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