diff options
author | Cozz Lovan <cozzlovan@yahoo.com> | 2014-06-10 03:14:13 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-05 13:25:12 +0100 |
commit | 90a43c1e93318584d5443b513c2c0e937acb966a (patch) | |
tree | 4ac3b6cac10908da18961d6423dc5bb6aad6a517 /src/qt/sendcoinsdialog.cpp | |
parent | 3dfcdf46c2c1a322b6649f04e8c9ca7636c5baf3 (diff) |
[Qt] Code-movement-only: Format confirmation message in sendcoinsdialog
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 5aef2d7539..4338e58e26 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -220,6 +220,36 @@ void SendCoinsDialog::on_sendButton_clicked() return; } + fNewRecipientAllowed = false; + + + WalletModel::UnlockContext ctx(model->requestUnlock()); + if(!ctx.isValid()) + { + // Unlock wallet was cancelled + fNewRecipientAllowed = true; + return; + } + + // prepare transaction for getting txFee earlier + WalletModelTransaction currentTransaction(recipients); + WalletModel::SendCoinsReturn prepareStatus; + if (model->getOptionsModel()->getCoinControlFeatures()) // coin control enabled + prepareStatus = model->prepareTransaction(currentTransaction, CoinControlDialog::coinControl); + else + prepareStatus = model->prepareTransaction(currentTransaction); + + // process prepareStatus and on error generate message shown to user + processSendCoinsReturn(prepareStatus, + BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), currentTransaction.getTransactionFee())); + + if(prepareStatus.status != WalletModel::OK) { + fNewRecipientAllowed = true; + return; + } + + CAmount txFee = currentTransaction.getTransactionFee(); + // Format confirmation message QStringList formatted; foreach(const SendCoinsRecipient &rcp, recipients) @@ -257,35 +287,6 @@ void SendCoinsDialog::on_sendButton_clicked() formatted.append(recipientElement); } - fNewRecipientAllowed = false; - - - WalletModel::UnlockContext ctx(model->requestUnlock()); - if(!ctx.isValid()) - { - // Unlock wallet was cancelled - fNewRecipientAllowed = true; - return; - } - - // prepare transaction for getting txFee earlier - WalletModelTransaction currentTransaction(recipients); - WalletModel::SendCoinsReturn prepareStatus; - if (model->getOptionsModel()->getCoinControlFeatures()) // coin control enabled - prepareStatus = model->prepareTransaction(currentTransaction, CoinControlDialog::coinControl); - else - prepareStatus = model->prepareTransaction(currentTransaction); - - // process prepareStatus and on error generate message shown to user - processSendCoinsReturn(prepareStatus, - BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), currentTransaction.getTransactionFee())); - - if(prepareStatus.status != WalletModel::OK) { - fNewRecipientAllowed = true; - return; - } - - CAmount txFee = currentTransaction.getTransactionFee(); QString questionString = tr("Are you sure you want to send?"); questionString.append("<br /><br />%1"); |