Skip to content

Commit

Permalink
fix coin control issue navcoin#822
Browse files Browse the repository at this point in the history
  • Loading branch information
alex v committed Apr 15, 2021
1 parent 4a825a8 commit 4c4b627
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ SendCoinsDialog::SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *pa
model(0),
fPrivate(false),
fNewRecipientAllowed(true),
platformStyle(platformStyle)
platformStyle(platformStyle),
fCoinControl(false)
{
ui->setupUi(this);

Expand Down Expand Up @@ -238,7 +239,7 @@ void SendCoinsDialog::on_sendButton_clicked()
CCoinControl* coinControl = fPrivate?CoinControlDialog::blscctCoinControl:CoinControlDialog::coinControl;

WalletModel::SendCoinsReturn prepareStatus;
if (model->getOptionsModel()->getCoinControlFeatures()) // coin control enabled
if (fCoinControl) // coin control enabled
prepareStatus = model->prepareTransaction(currentTransaction, nTotalAmount, coinControl, &selectedCoins);
else
prepareStatus = model->prepareTransaction(currentTransaction, nTotalAmount, 0, &selectedCoins);
Expand Down Expand Up @@ -804,13 +805,15 @@ void SendCoinsDialog::coinControlUpdateLabels()
setBalance(ccAmount, 0, 0, 0, 0, 0, 0, 0, privBalance, 0, 0);
// show coin control stats
ui->widgetCoinControl->show();
fCoinControl = true;
}
else
{
// hide coin control stats
ui->widgetCoinControl->hide();
ui->labelCoinControlInsuffFunds->hide();
setBalance(pubBalance, 0, 0, 0, 0, 0, 0, 0, privBalance, 0, 0);
fCoinControl = false;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/qt/sendcoinsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public Q_SLOTS:
const PlatformStyle *platformStyle;
bool fPrivate;
QString sChangeAddress;
bool fCoinControl;

CAmount pubBalance;
CAmount privBalance;
Expand Down

0 comments on commit 4c4b627

Please sign in to comment.