mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
qt, wallet, refactor: Make WalletModel::sendCoins()
return void
Currently, the `WalletModel::sendCoins()` function always returns the same value. Also dead and noop code has been removed.
This commit is contained in:
parent
ba48fcf4a4
commit
1f653dc262
3 changed files with 4 additions and 13 deletions
|
@ -543,15 +543,8 @@ void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
|
||||||
// failed, or more signatures are needed.
|
// failed, or more signatures are needed.
|
||||||
if (broadcast) {
|
if (broadcast) {
|
||||||
// now send the prepared transaction
|
// now send the prepared transaction
|
||||||
WalletModel::SendCoinsReturn sendStatus = model->sendCoins(*m_current_transaction);
|
model->sendCoins(*m_current_transaction);
|
||||||
// process sendStatus and on error generate message shown to user
|
Q_EMIT coinsSent(m_current_transaction->getWtx()->GetHash());
|
||||||
processSendCoinsReturn(sendStatus);
|
|
||||||
|
|
||||||
if (sendStatus.status == WalletModel::OK) {
|
|
||||||
Q_EMIT coinsSent(m_current_transaction->getWtx()->GetHash());
|
|
||||||
} else {
|
|
||||||
send_failure = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!send_failure) {
|
if (!send_failure) {
|
||||||
|
|
|
@ -234,7 +234,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
|
||||||
return SendCoinsReturn(OK);
|
return SendCoinsReturn(OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &transaction)
|
void WalletModel::sendCoins(WalletModelTransaction& transaction)
|
||||||
{
|
{
|
||||||
QByteArray transaction_array; /* store serialized transaction */
|
QByteArray transaction_array; /* store serialized transaction */
|
||||||
|
|
||||||
|
@ -280,8 +280,6 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
|
||||||
}
|
}
|
||||||
|
|
||||||
checkBalanceChanged(m_wallet->getBalances()); // update balance immediately, otherwise there could be a short noticeable delay until pollBalanceChanged hits
|
checkBalanceChanged(m_wallet->getBalances()); // update balance immediately, otherwise there could be a short noticeable delay until pollBalanceChanged hits
|
||||||
|
|
||||||
return SendCoinsReturn(OK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OptionsModel* WalletModel::getOptionsModel() const
|
OptionsModel* WalletModel::getOptionsModel() const
|
||||||
|
|
|
@ -103,7 +103,7 @@ public:
|
||||||
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const wallet::CCoinControl& coinControl);
|
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const wallet::CCoinControl& coinControl);
|
||||||
|
|
||||||
// Send coins to a list of recipients
|
// Send coins to a list of recipients
|
||||||
SendCoinsReturn sendCoins(WalletModelTransaction &transaction);
|
void sendCoins(WalletModelTransaction& transaction);
|
||||||
|
|
||||||
// Wallet encryption
|
// Wallet encryption
|
||||||
bool setWalletEncrypted(const SecureString& passphrase);
|
bool setWalletEncrypted(const SecureString& passphrase);
|
||||||
|
|
Loading…
Add table
Reference in a new issue