Merge bitcoin-core/gui#653: Show watchonly balance only for Legacy wallets

fdb8dc8a5a gui: Show watchonly balance only for Legacy wallets (Andrew Chow)

Pull request description:

  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"

ACKs for top commit:
  johnny9:
    tACK fdb8dc8a5a
  furszy:
    ACK fdb8dc8a
  hebasto:
    ACK fdb8dc8a5a

Tree-SHA512: e5c0703a62d25c881c8dadfb9cffd482791f3d437a4ec5ae0088ce1a2069c2455ad6d3ec6c95a4404a3b55fbd727f92694529c35052236951553ca90c4ed31b5
This commit is contained in:
Hennadii Stepanov 2023-02-03 19:16:26 +00:00
commit 2ccd7be26f
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -699,7 +699,7 @@ void SendCoinsDialog::setBalance(const interfaces::WalletBalances& balances)
CAmount balance = balances.balance;
if (model->wallet().hasExternalSigner()) {
ui->labelBalanceName->setText(tr("External balance:"));
} else if (model->wallet().privateKeysDisabled()) {
} else if (model->wallet().isLegacy() && model->wallet().privateKeysDisabled()) {
balance = balances.watch_only_balance;
ui->labelBalanceName->setText(tr("Watch-only balance:"));
}