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)
777777 // Include watch-only for wallets without private key
778778 m_coin_control->fAllowWatchOnly = model->wallet ().privateKeysDisabled () && !model->wallet ().hasExternalSigner ();
779779
780+ SendAssetsRecipient recipient = entry->getValue ();
780781 // 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 );
782783 for (int i = 0 ; i < ui->entries ->count (); ++i) {
783784 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 ) {
785786 amount -= e->getValue ().asset_amount ;
786787 }
787788 }
788789
789790 if (amount > 0 ) {
790- entry->checkSubtractFeeFromAmount ();
791- entry->setAmount (amount);
791+ if (recipient.asset == ::policyAsset) {
792+ entry->checkSubtractFeeFromAmount ();
793+ }
794+ recipient.asset_amount = amount;
792795 } else {
793- entry-> setAmount ( 0 ) ;
796+ recipient. asset_amount = 0 ;
794797 }
798+ entry->setValue (recipient);
795799}
796800
797801void SendCoinsDialog::updateFeeSectionControls ()
You can’t perform that action at this time.
0 commit comments