[gui] send: show watch-only balance in send screen

This commit is contained in:
Sjors Provoost 2019-11-26 11:43:53 +01:00
parent 2689c8fd71
commit 4a96e459d7
No known key found for this signature in database
GPG key ID: 57FF9BDBCC301009
2 changed files with 7 additions and 2 deletions

View file

@ -1190,7 +1190,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis p
<number>3</number>
</property>
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelBalanceName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>

View file

@ -562,7 +562,12 @@ void SendCoinsDialog::setBalance(const interfaces::WalletBalances& balances)
{
if(model && model->getOptionsModel())
{
ui->labelBalance->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), balances.balance));
CAmount balance = balances.balance;
if (model->privateKeysDisabled()) {
balance = balances.watch_only_balance;
ui->labelBalanceName->setText(tr("Watch-only balance:"));
}
ui->labelBalance->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), balance));
}
}