Show watchonly balance only for Legacy wallets #653

pull achow101 wants to merge 1 commits into bitcoin-core:master from achow101:show-bal-send changing 1 files +1 −1
  1. achow101 commented at 8:19 pm on August 14, 2022: member

    Descriptor wallets do not have a watchonly balance as wallets are designated watchonly or not. Thus we should not be displaying the empty watchonly balance for descriptor wallets.

    The result is that instead of the send page showing “Watch-only balance: 0.00000000 BTC” for watchonly descriptor wallets, we see the actual balance as “Balance: 10.00000000 BTC”

  2. gui: Show watchonly balance only for Legacy wallets
    Descriptor wallets do not have a watchonly balance as wallets are
    designated watchonly or not. Thus we should not be displaying the empty
    watchonly balance for descriptor wallets.
    fdb8dc8a5a
  3. jarolrod added the label UX on Aug 14, 2022
  4. hebasto renamed this:
    gui: Show watchonly balance only for Legacy wallets
    Show watchonly balance only for Legacy wallets
    on Aug 15, 2022
  5. hebasto added the label Wallet on Aug 15, 2022
  6. luke-jr commented at 1:14 am on August 19, 2022: member
    Hmm, maybe we should hide the “Balance” for watch-only descriptor wallets, and show the right thing as watch-only?
  7. luke-jr commented at 0:00 am on September 4, 2022: member

    eg

     0--- a/src/qt/sendcoinsdialog.cpp
     1+++ b/src/qt/sendcoinsdialog.cpp
     2@@ -702,7 +702,9 @@ void SendCoinsDialog::setBalance(const interfaces::WalletBalances& balances)
     3         if (model->wallet().hasExternalSigner()) {
     4             ui->labelBalanceName->setText(tr("External balance:"));
     5         } else if (model->wallet().privateKeysDisabled()) {
     6-            balance = balances.watch_only_balance;
     7+            if (model->wallet().isLegacy()) {
     8+                balance = balances.watch_only_balance;
     9+            }
    10             ui->labelBalanceName->setText(tr("Watch-only balance:"));
    11         }
    12         ui->labelBalance->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), balance));
    
  8. hernanmarino commented at 4:30 pm on September 20, 2022: contributor

    tACK.

    This might be slightly off-topic, but shouldn’t the whole “Receive” dialog be disabled when the wallet is unable to generate addresses ? Currently, only the receive button is disabled.

  9. pablomartin4btc approved
  10. pablomartin4btc commented at 8:24 pm on September 20, 2022: contributor

    Tested ACK (using signet).

    Reproduced the issue (watchonly descritor wallets with a balance show watch-only balance 0 on the Send window):

    image

    image

    I’ve verified that it has been fixed with this change (now it shows balance with the total amount on the Send window matching the one shown on the overview window):

    image

    Checked also on a descriptor watch-only blank wallet and using importdescriptors function to have some balance within.

    As @luke-jr, we could be still showing “watch-only balance” for watch-only descriptor wallets with the balance amount as shown in the overview window instead of the current solution, reafirming that we are on a watch-only wallet.

    On @hernanmarino’s comment, I think it makes sense to grey out the Receive button when the wallets can’t generate addresses avoiding displaying the whole thing:

    image

  11. johnny9 approved
  12. johnny9 commented at 1:47 am on January 1, 2023: contributor

    tACK fdb8dc8a5a10c39927dc4b8ddc5e0038a633c50e

    Tested on signet by creating a no-private-key descriptor wallet and then using the importdescriptor command to add an address with funds on it.

    on master (65de8eeeca29e71378aa34602b287ab921b040e4): Send dialog shows invalid watch-only balance

    Screenshot from 2022-12-31 20-15-03

    PR (fdb8dc8a5a10c39927dc4b8ddc5e0038a633c50e): Send dialog shows correct balance

    Screenshot from 2022-12-31 20-38-22

  13. DrahtBot commented at 1:47 am on January 1, 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 johnny9, furszy, hebasto
    Concept ACK hernanmarino, pablomartin4btc

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

  14. pablomartin4btc commented at 8:52 pm on February 1, 2023: contributor
    @achow101 are you planning to move ahead with this? any stoppers?
  15. achow101 commented at 9:11 pm on February 1, 2023: member

    @achow101 are you planning to move ahead with this? any stoppers?

    Just waiting for reviewers.

  16. furszy approved
  17. furszy commented at 4:20 pm on February 3, 2023: member

    ACK fdb8dc8a

    Inlines the balance presented in the send screen with the balance presented in the overview screen.

    Not for this PR but would be good to have a visual distinction between wallets with private keys enabled vs wallets without private keys enabled (The previous “watch-only” wording wasn’t that bad to fulfill the purpose).

  18. hebasto approved
  19. hebasto commented at 7:16 pm on February 3, 2023: member

    ACK fdb8dc8a5a10c39927dc4b8ddc5e0038a633c50e

    Comments about further UX improving could be addressed in follow ups.

  20. hebasto merged this on Feb 3, 2023
  21. hebasto closed this on Feb 3, 2023

  22. sidhujag referenced this in commit ff8c085d67 on Feb 3, 2023
  23. bitcoin-core locked this on Feb 3, 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