Merge pull request #1222 from andreabonel/qt_avoid_mixing_assets_when_using_all_the_available

Elements-qt: Avoid mixing assets when using all the available balance
This commit is contained in:
Byron Hambly 2023-03-17 13:41:54 +02:00 committed by GitHub
commit 63d79dda82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -781,7 +781,7 @@ void SendCoinsDialog::useAvailableBalance(SendCoinsEntry* entry)
CAmount amount = valueFor(model->wallet().getAvailableBalance(*m_coin_control), ::policyAsset);
for (int i = 0; i < ui->entries->count(); ++i) {
SendCoinsEntry* e = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
if (e && !e->isHidden() && e != entry) {
if (e && !e->isHidden() && e != entry && e->getValue().asset == ::policyAsset) {
amount -= e->getValue().asset_amount;
}
}