File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -791,21 +791,25 @@ void SendCoinsDialog::useAvailableBalance(SendCoinsEntry* entry)
791
791
// Include watch-only for wallets without private key
792
792
m_coin_control->fAllowWatchOnly = model->wallet ().privateKeysDisabled () && !model->wallet ().hasExternalSigner ();
793
793
794
+ SendAssetsRecipient recipient = entry->getValue ();
794
795
// Calculate available amount to send.
795
- CAmount amount = valueFor (model->wallet ().getAvailableBalance (*m_coin_control), ::policyAsset );
796
+ CAmount amount = valueFor (model->wallet ().getAvailableBalance (*m_coin_control), recipient. asset );
796
797
for (int i = 0 ; i < ui->entries ->count (); ++i) {
797
798
SendCoinsEntry* e = qobject_cast<SendCoinsEntry*>(ui->entries ->itemAt (i)->widget ());
798
- if (e && !e->isHidden () && e != entry && e->getValue ().asset == ::policyAsset ) {
799
+ if (e && !e->isHidden () && e != entry && e->getValue ().asset == recipient. asset ) {
799
800
amount -= e->getValue ().asset_amount ;
800
801
}
801
802
}
802
803
803
804
if (amount > 0 ) {
804
- entry->checkSubtractFeeFromAmount ();
805
- entry->setAmount (amount);
805
+ if (recipient.asset == ::policyAsset) {
806
+ entry->checkSubtractFeeFromAmount ();
807
+ }
808
+ recipient.asset_amount = amount;
806
809
} else {
807
- entry-> setAmount ( 0 ) ;
810
+ recipient. asset_amount = 0 ;
808
811
}
812
+ entry->setValue (recipient);
809
813
}
810
814
811
815
void SendCoinsDialog::updateFeeSectionControls ()
You can’t perform that action at this time.
0 commit comments