Skip to content

Commit

Permalink
fixup! [Qt] Add simple optin-RBF checkbox and confirmation info
Browse files Browse the repository at this point in the history
Set signalRbf via CCoinControl as suggested by
Luke Dashjr <luke-jr+git@utopios.org> in
bitcoin#9592 (comment)
  • Loading branch information
ryanofsky committed Jan 23, 2017
1 parent 74a594d commit bfdb09f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ void SendCoinsDialog::on_sendButton_clicked()
else
ctrl.nConfirmTarget = 0;

prepareStatus = model->prepareTransaction(currentTransaction, &ctrl, ui->optInRBF->isChecked());
ctrl.signalRbf = ui->optInRBF->isChecked();

prepareStatus = model->prepareTransaction(currentTransaction, &ctrl);

// process prepareStatus and on error generate message shown to user
processSendCoinsReturn(prepareStatus,
Expand Down
4 changes: 2 additions & 2 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ bool WalletModel::validateAddress(const QString &address)
return addressParsed.IsValid();
}

WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransaction &transaction, const CCoinControl *coinControl, bool optInRBF)
WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransaction &transaction, const CCoinControl *coinControl)
{
CAmount total = 0;
bool fSubtractFeeFromAmount = false;
Expand Down Expand Up @@ -277,7 +277,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact

CWalletTx *newTx = transaction.getTransaction();
CReserveKey *keyChange = transaction.getPossibleKeyChange();
bool fCreated = wallet->CreateTransaction(vecSend, *newTx, *keyChange, nFeeRequired, nChangePosRet, strFailReason, coinControl, optInRBF ? CREATE_TX_ENABLE_RBF : CREATE_TX_DISABLE_RBF);
bool fCreated = wallet->CreateTransaction(vecSend, *newTx, *keyChange, nFeeRequired, nChangePosRet, strFailReason, coinControl);
transaction.setTransactionFee(nFeeRequired);
if (fSubtractFeeFromAmount && fCreated)
transaction.reassignAmounts(nChangePosRet);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class WalletModel : public QObject
};

// prepare transaction for getting txfee before sending coins
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const CCoinControl *coinControl = NULL, bool optInRBF = false);
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const CCoinControl *coinControl);

// Send coins to a list of recipients
SendCoinsReturn sendCoins(WalletModelTransaction &transaction);
Expand Down

0 comments on commit bfdb09f

Please sign in to comment.