MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / useAvailableBalance

Method useAvailableBalance

src/qt/sendcoinsdialog.cpp:612–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610}
611
612void SendCoinsDialog::useAvailableBalance(SendCoinsEntry* entry)
613{
614 // Get CCoinControl instance if CoinControl is enabled or create a new one.
615 CCoinControl coin_control;
616 if (model->getOptionsModel()->getCoinControlFeatures()) {
617 coin_control = *CoinControlDialog::coinControl();
618 }
619
620 // Calculate available amount to send.
621 CAmount amount = model->wallet().getAvailableBalance(coin_control);
622 for (int i = 0; i < ui->entries->count(); ++i) {
623 SendCoinsEntry* e = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
624 if (e && !e->isHidden() && e != entry) {
625 amount -= e->getValue().amount;
626 }
627 }
628
629 if (amount > 0) {
630 entry->checkSubtractFeeFromAmount();
631 entry->setAmount(amount);
632 } else {
633 entry->setAmount(0);
634 }
635}
636
637void SendCoinsDialog::setMinimumFee()
638{

Callers

nothing calls this directly

Calls 7

getAvailableBalanceMethod · 0.80
getValueMethod · 0.80
setAmountMethod · 0.80
getOptionsModelMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected