-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Multiwallet for the GUI #12610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiwallet for the GUI #12610
Conversation
cfca2c5 to
98cce65
Compare
Sjors
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think it's better to use the menu rather than add a dropbox, but as long as it's easy to change later it doesn't matter. I left some comments to better separate UI from model to make such a change easier. That already improved in this PR compared to #11383.
Nit: "Loading wallet" should be "Loading wallets" if there's more than 1.
src/qt/bitcoingui.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first item in the menu is now created in the UI file, while new ones are created programatically. Can you make them all programmatically or maybe find a way to clone elements? Can be done in a future PR too.
src/qt/walletmodel.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a method on WalletModel? Otherwise you could use m_wallet_models->count(). Maybe we need a WalletsModel class to hold on to a series of wallets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the best place for wallets manager functions like this is currently the WalletModel, long term, we may want to have a WalletsManager (see #12587).
src/qt/bitcoingui.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fixed right? At least there's \n in the Amount: above.
|
This is strictly an inferior design to #11383, which already has ACKs and is ready for merging as-is. The minor other improvements can be done on top of that. |
|
@luke-jr it's not strictly better; this PR has a cleaner separation of model and view. I can't speak to the other differences. |
|
Let's stop arguing just for sake of arguing and help move this forward. If this is not the perfect design I'm sure it can be improved in a later PR. I'll test it later. |
|
Why does stop arguing mean merging this PR? #11383 is already reviewed and ready to merge... |
|
Should rebase to have external wallet support (#11687). |
promag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK.
Receiving addresses and Sending addresses dialogs could have the wallet name in the dialog title.
src/qt/sendcoinsdialog.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the underline, it's already bold.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its okay since the used wallet is a pretty critical information. Overhauling the send-confirmation dialog is something that would be possible in the long run.
src/qt/bitcoingui.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, remove extra space before {.
src/qt/bitcoingui.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fixed right? At least there's \n in the Amount: above.
98cce65 to
3b156cf
Compare
|
Added a commit that fixes the |
jnewbery
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK 3b156cf01fda530cca127079d630c295d839efc1, although I'm not very familiar with the qt code.
To aid review, the commits could be tidied up a little (some code is added and removed in a later commit) and squashed a bit.
A couple of comments inline.
src/qt/walletmodel.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that we should strip .dat from the wallet name now that #11687 is merged. Perhaps @ryanofsky has an opinion on this?
Also note that new default wallets will have the name "" (the empty string). Perhaps QT should display something different in this case?
EDIT: for now, I think the only way we can have the default wallet with its name set to "" is if we start bitcoin with no wallet arguments, in which case multiwallet isn't active and the dropdown won't appear. However, in future we'll have dynamic wallet loading/unloading, in which case we could have the default "" wallet plus named wallets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. For sure something to deal with later.
src/qt/rpcconsole.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment is outdated and can be removed
…t at all until needed
3b156cf to
779c5f9
Compare
|
Force push fixed the outdated commit. |
779c5f9 Qt: hide RPCConsole wallet selector when no wallets are present (Jonas Schnelli) dc6f150 Qt: show wallet name in request dlg in case of multiwallet (Jonas Schnelli) 4826ca4 Qt: show wallet name in send confirmation dlg in case of multiwallet (Jonas Schnelli) cfa4133 GUI: RPCConsole: Log wallet changes (Luke Dashjr) b6d04fc Qt: Get wallet name from WalletModel rather than passing it around (Luke Dashjr) 12d8d26 Qt: When multiple wallets are used, include in notifications the name (Jonas Schnelli) d1ec34a Qt: QComboBox::setVisible doesn't work in toolbars, so defer adding it at all until needed (Luke Dashjr) d49cc70 Qt: Add wallet selector to debug console (Jonas Schnelli) d558f44 Bugfix: RPC: Add missing UnregisterHTTPHandler for /wallet/ (Luke Dashjr) 85d5319 Qt: Ensure UI updates only come from the currently selected walletView (Luke Dashjr) e449f9a Qt: Add a combobox to toolbar to select from multiple wallets (Luke Dashjr) 3dba3c3 Qt: Load all wallets into WalletModels (Luke Dashjr) Pull request description: This is an overhaul of #11383 (plus some additions). It avoids unnecessary coupling of httpserver/jsonrpc and the wallet as well as it avoids pointer pure passing (and pointer deletion) of `CWallet` (plus other minor design changes). Additionally it adds the wallet name to the sendconfirmation and request dialog (in case multiwallet is active) Tree-SHA512: 3d06e18badbc5d1821e488bf1dae463bb0be544cf11b2b618e025812bfdd13c5f39604bb93b4c705313930e7dc4e66f4848b9469ba14871bade58e7a027246a1
|
argh, sorry for the late review this logic here means that anytime we do a wallet match on rpc debug console, it will not find the wallet unless it has no This also means you can load two wallets(eg imo if we're supporting arbitrary filename extensions we should just display the entire name |
Agree, it would be good to drop the special |
|
I also agree that we should remove the special |
|
Totally un-user-friendly. If we merged #11383 without the ugly regressions herein, it wouldn't have been a problem... |
Summary: Completes T440 Original commit messages below: ------------------------------- PR12610: Merge #12610: Multiwallet for the GUI 779c5f9 Qt: hide RPCConsole wallet selector when no wallets are present (Jonas Schnelli) dc6f150 Qt: show wallet name in request dlg in case of multiwallet (Jonas Schnelli) 4826ca4 Qt: show wallet name in send confirmation dlg in case of multiwallet (Jonas Schnelli) cfa4133 GUI: RPCConsole: Log wallet changes (Luke Dashjr) b6d04fc Qt: Get wallet name from WalletModel rather than passing it around (Luke Dashjr) 12d8d26 Qt: When multiple wallets are used, include in notifications the name (Jonas Schnelli) d1ec34a Qt: QComboBox::setVisible doesn't work in toolbars, so defer adding it at all until needed (Luke Dashjr) d49cc70 Qt: Add wallet selector to debug console (Jonas Schnelli) d558f44 Bugfix: RPC: Add missing UnregisterHTTPHandler for /wallet/ (Luke Dashjr) 85d5319 Qt: Ensure UI updates only come from the currently selected walletView (Luke Dashjr) e449f9a Qt: Add a combobox to toolbar to select from multiple wallets (Luke Dashjr) 3dba3c3 Qt: Load all wallets into WalletModels (Luke Dashjr) Pull request description: This is an overhaul of #11383 (plus some additions). It avoids unnecessary coupling of httpserver/jsonrpc and the wallet as well as it avoids pointer pure passing (and pointer deletion) of `CWallet` (plus other minor design changes). Additionally it adds the wallet name to the sendconfirmation and request dialog (in case multiwallet is active) Tree-SHA512: 3d06e18badbc5d1821e488bf1dae463bb0be544cf11b2b618e025812bfdd13c5f39604bb93b4c705313930e7dc4e66f4848b9469ba14871bade58e7a027246a1 Includes PR12795, since PR12610 introduced a bug: Do not truncate .dat extension for wallets in gui See bitcoin/bitcoin#12610 (comment) for details Co-authored-by: Jason B. Cox <contact@jasonbcox.com> Test Plan: `ninja check && ninja check-functional` `./src/qt/bitcoin-qt -testnet -wallet=wallet1 -wallet=wallet2` Verify the following: 1. Visually verify that the wallet dropdown exists in the upper right-hand corner. 2. Selecting a wallet from the dropdown displays the transactions only associated with that wallet. 3. Requesting payment on a specified wallet generates an address for that wallet. 4. Visually verify that Debug window now has a dropdown containing both wallet options. 5. Selecting a particular wallet from the Debug dropdown and trying RPC commands only provides output relevant to the selected wallet (I used transaction IDs only known to one of the wallets to verify). Reviewers: deadalnix, schancel, #bitcoin_abc, Fabien Reviewed By: deadalnix, #bitcoin_abc, Fabien Subscribers: Fabien, teamcity Differential Revision: https://reviews.bitcoinabc.org/D1979
779c5f9 Qt: hide RPCConsole wallet selector when no wallets are present (Jonas Schnelli) dc6f150 Qt: show wallet name in request dlg in case of multiwallet (Jonas Schnelli) 4826ca4 Qt: show wallet name in send confirmation dlg in case of multiwallet (Jonas Schnelli) cfa4133 GUI: RPCConsole: Log wallet changes (Luke Dashjr) b6d04fc Qt: Get wallet name from WalletModel rather than passing it around (Luke Dashjr) 12d8d26 Qt: When multiple wallets are used, include in notifications the name (Jonas Schnelli) d1ec34a Qt: QComboBox::setVisible doesn't work in toolbars, so defer adding it at all until needed (Luke Dashjr) d49cc70 Qt: Add wallet selector to debug console (Jonas Schnelli) d558f44 Bugfix: RPC: Add missing UnregisterHTTPHandler for /wallet/ (Luke Dashjr) 85d5319 Qt: Ensure UI updates only come from the currently selected walletView (Luke Dashjr) e449f9a Qt: Add a combobox to toolbar to select from multiple wallets (Luke Dashjr) 3dba3c3 Qt: Load all wallets into WalletModels (Luke Dashjr) Pull request description: This is an overhaul of bitcoin#11383 (plus some additions). It avoids unnecessary coupling of httpserver/jsonrpc and the wallet as well as it avoids pointer pure passing (and pointer deletion) of `CWallet` (plus other minor design changes). Additionally it adds the wallet name to the sendconfirmation and request dialog (in case multiwallet is active) Tree-SHA512: 3d06e18badbc5d1821e488bf1dae463bb0be544cf11b2b618e025812bfdd13c5f39604bb93b4c705313930e7dc4e66f4848b9469ba14871bade58e7a027246a1
779c5f9 Qt: hide RPCConsole wallet selector when no wallets are present (Jonas Schnelli) dc6f150 Qt: show wallet name in request dlg in case of multiwallet (Jonas Schnelli) 4826ca4 Qt: show wallet name in send confirmation dlg in case of multiwallet (Jonas Schnelli) cfa4133 GUI: RPCConsole: Log wallet changes (Luke Dashjr) b6d04fc Qt: Get wallet name from WalletModel rather than passing it around (Luke Dashjr) 12d8d26 Qt: When multiple wallets are used, include in notifications the name (Jonas Schnelli) d1ec34a Qt: QComboBox::setVisible doesn't work in toolbars, so defer adding it at all until needed (Luke Dashjr) d49cc70 Qt: Add wallet selector to debug console (Jonas Schnelli) d558f44 Bugfix: RPC: Add missing UnregisterHTTPHandler for /wallet/ (Luke Dashjr) 85d5319 Qt: Ensure UI updates only come from the currently selected walletView (Luke Dashjr) e449f9a Qt: Add a combobox to toolbar to select from multiple wallets (Luke Dashjr) 3dba3c3 Qt: Load all wallets into WalletModels (Luke Dashjr) Pull request description: This is an overhaul of bitcoin#11383 (plus some additions). It avoids unnecessary coupling of httpserver/jsonrpc and the wallet as well as it avoids pointer pure passing (and pointer deletion) of `CWallet` (plus other minor design changes). Additionally it adds the wallet name to the sendconfirmation and request dialog (in case multiwallet is active) Tree-SHA512: 3d06e18badbc5d1821e488bf1dae463bb0be544cf11b2b618e025812bfdd13c5f39604bb93b4c705313930e7dc4e66f4848b9469ba14871bade58e7a027246a1




This is an overhaul of #11383 (plus some additions).
It avoids unnecessary coupling of httpserver/jsonrpc and the wallet as well as it avoids pointer pure passing (and pointer deletion) of
CWallet(plus other minor design changes).Additionally it adds the wallet name to the sendconfirmation and request dialog (in case multiwallet is active)