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 @@ -777,21 +777,25 @@ void SendCoinsDialog::useAvailableBalance(SendCoinsEntry* entry)
777
777
// Include watch-only for wallets without private key
778
778
m_coin_control->fAllowWatchOnly = model->wallet ().privateKeysDisabled () && !model->wallet ().hasExternalSigner ();
779
779
780
+ SendAssetsRecipient recipient = entry->getValue ();
780
781
// Calculate available amount to send.
781
- CAmount amount = valueFor (model->wallet ().getAvailableBalance (*m_coin_control), ::policyAsset );
782
+ CAmount amount = valueFor (model->wallet ().getAvailableBalance (*m_coin_control), recipient. asset );
782
783
for (int i = 0 ; i < ui->entries ->count (); ++i) {
783
784
SendCoinsEntry* e = qobject_cast<SendCoinsEntry*>(ui->entries ->itemAt (i)->widget ());
784
- if (e && !e->isHidden () && e != entry && e->getValue ().asset == ::policyAsset ) {
785
+ if (e && !e->isHidden () && e != entry && e->getValue ().asset == recipient. asset ) {
785
786
amount -= e->getValue ().asset_amount ;
786
787
}
787
788
}
788
789
789
790
if (amount > 0 ) {
790
- entry->checkSubtractFeeFromAmount ();
791
- entry->setAmount (amount);
791
+ if (recipient.asset == ::policyAsset) {
792
+ entry->checkSubtractFeeFromAmount ();
793
+ }
794
+ recipient.asset_amount = amount;
792
795
} else {
793
- entry-> setAmount ( 0 ) ;
796
+ recipient. asset_amount = 0 ;
794
797
}
798
+ entry->setValue (recipient);
795
799
}
796
800
797
801
void SendCoinsDialog::updateFeeSectionControls ()
You can’t perform that action at this time.
0 commit comments