Skip to content

GUI: Keep the RPC console on the wallet it is set to - #344

Merged
luke-jr merged 1 commit into
bitcoinknots:29.x-knotsfrom
privkeyio:fix-rpcconsole-wallet-selection-consistency
Aug 7, 2026
Merged

GUI: Keep the RPC console on the wallet it is set to#344
luke-jr merged 1 commit into
bitcoinknots:29.x-knotsfrom
privkeyio:fix-rpcconsole-wallet-selection-consistency

Conversation

@kwsantiago

@kwsantiago kwsantiago commented Jul 25, 2026

Copy link
Copy Markdown

Bugfix-only alternative to #331, for the case where the feature in that PR is not wanted.

99c0eb9 ("Fix RPCConsole wallet selection") made the RPC console follow the wallet opened from the menu bar, but only for the open, restore and create activities. The toolbar selector and wallet migration were never connected, so the console follows the main window on some paths and not others, and a wallet deliberately picked in the console gets overridden by the paths that are connected.

This drops those three connects, so the console keeps whatever wallet it is set to. It defaults to the first wallet loaded, as RPCConsole::addWallet() already does, and only the console's own selector changes it.

Based on branch-26 (96ec3b6), the oldest branch carrying the connects.

Testing

bitcoin-qt on regtest, started with wallet_a and wallet_b, console selector on wallet_a.

  • File > Open Wallet on a third wallet: the main window switches to it, the console stays on wallet_a and commands run against wallet_a. Before this change the console jumped to the newly opened wallet.
  • File > Create Wallet: same, the console stays on wallet_a.
  • Merged into 29.x-knots and test_bitcoin-qt passes.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR changes the Qt RPC console wallet selection behavior so it remains on the wallet chosen within the console, instead of being overridden by wallet open/restore/create flows in the main window.

Changes:

  • Removed RPCConsole::setCurrentWallet() API (declaration + implementation).
  • Dropped signal/slot connections from wallet open/restore/create activities that forced the RPC console to switch wallets.
  • Kept existing default behavior where the console initially selects the first loaded wallet via RPCConsole::addWallet().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/qt/rpcconsole.h Removes the setCurrentWallet slot from the RPC console interface.
src/qt/rpcconsole.cpp Removes the setCurrentWallet implementation that updated the wallet selector index.
src/qt/bitcoingui.cpp Removes connections that previously changed the RPC console wallet during open/restore/create wallet flows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/qt/rpcconsole.cpp
@kwsantiago
kwsantiago force-pushed the fix-rpcconsole-wallet-selection-consistency branch from 2cbc43f to 020102d Compare July 25, 2026 19:55
@kwsantiago
kwsantiago requested a review from luke-jr July 25, 2026 19:59
@kwsantiago
kwsantiago force-pushed the fix-rpcconsole-wallet-selection-consistency branch from 020102d to 2b54c09 Compare July 26, 2026 01:02
@kwsantiago

Copy link
Copy Markdown
Author

Rebased onto branch-26 (96ec3b6), the oldest branch with the connects. Applies clean there and merges forward into 29.x-knots with the same result.

#331 is standalone again rather than stacked on this, so either can be taken alone. Both merge together without conflict.

@luke-jr
luke-jr merged commit 966a8f1 into bitcoinknots:29.x-knots Aug 7, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants