mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
Merge bitcoin-core/gui#608: wallet, refactor: Make WalletModel::sendCoins()
return void
1f653dc262
qt, wallet, refactor: Make `WalletModel::sendCoins()` return `void` (Hennadii Stepanov) Pull request description: Currently, the `WalletModel::sendCoins()` function always returns the same value. Also dead and noop (calling `processSendCoinsReturn(OK)`) code has been removed. The other `return` statements have been removed from the `WalletModel::sendCoins()` function in bitcoin/bitcoin#17154 and bitcoin/bitcoin#17165. ACKs for top commit: kristapsk: cr ACK1f653dc262
furszy: Code review ACK1f653dc2
shaavan: Code Review ACK1f653dc262
w0xlt: Code Review ACK1f653dc262
Tree-SHA512: 2b59495a7fc10b4de30fcc63fc3af92d50406e16031112eb72494736dce193ac1fbac0802623496cf81edcd16766e1647d9c4f3a607b3eb84cc50e273b999c04
This commit is contained in:
commit
9ef180a0ab
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.
|
||||
if (broadcast) {
|
||||
// now send the prepared transaction
|
||||
WalletModel::SendCoinsReturn sendStatus = model->sendCoins(*m_current_transaction);
|
||||
// process sendStatus and on error generate message shown to user
|
||||
processSendCoinsReturn(sendStatus);
|
||||
|
||||
if (sendStatus.status == WalletModel::OK) {
|
||||
Q_EMIT coinsSent(m_current_transaction->getWtx()->GetHash());
|
||||
} else {
|
||||
send_failure = true;
|
||||
}
|
||||
model->sendCoins(*m_current_transaction);
|
||||
Q_EMIT coinsSent(m_current_transaction->getWtx()->GetHash());
|
||||
}
|
||||
}
|
||||
if (!send_failure) {
|
||||
|
|
|
@ -234,7 +234,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
|
|||
return SendCoinsReturn(OK);
|
||||
}
|
||||
|
||||
WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &transaction)
|
||||
void WalletModel::sendCoins(WalletModelTransaction& 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
|
||||
|
||||
return SendCoinsReturn(OK);
|
||||
}
|
||||
|
||||
OptionsModel* WalletModel::getOptionsModel() const
|
||||
|
|
|
@ -102,7 +102,7 @@ public:
|
|||
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const wallet::CCoinControl& coinControl);
|
||||
|
||||
// Send coins to a list of recipients
|
||||
SendCoinsReturn sendCoins(WalletModelTransaction &transaction);
|
||||
void sendCoins(WalletModelTransaction& transaction);
|
||||
|
||||
// Wallet encryption
|
||||
bool setWalletEncrypted(const SecureString& passphrase);
|
||||
|
|
Loading…
Add table
Reference in a new issue