mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
[wallet] Remove return value from CommitTransaction()
CommitTransaction returns a bool to indicate success, but since commit
b3a74100b8 it only returns true, even if the transaction was not
successfully broadcast. This commit changes CommitTransaction() to return
void.
All dead code in `if (!CommitTransaction())` branches has been removed.
This commit is contained in:
@@ -218,19 +218,14 @@ public:
|
||||
}
|
||||
return tx;
|
||||
}
|
||||
bool commitTransaction(CTransactionRef tx,
|
||||
void commitTransaction(CTransactionRef tx,
|
||||
WalletValueMap value_map,
|
||||
WalletOrderForm order_form,
|
||||
std::string& reject_reason) override
|
||||
WalletOrderForm order_form) override
|
||||
{
|
||||
auto locked_chain = m_wallet->chain().lock();
|
||||
LOCK(m_wallet->cs_wallet);
|
||||
CValidationState state;
|
||||
if (!m_wallet->CommitTransaction(std::move(tx), std::move(value_map), std::move(order_form), state)) {
|
||||
reject_reason = state.GetRejectReason();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
m_wallet->CommitTransaction(std::move(tx), std::move(value_map), std::move(order_form), state);
|
||||
}
|
||||
bool transactionCanBeAbandoned(const uint256& txid) override { return m_wallet->TransactionCanBeAbandoned(txid); }
|
||||
bool abandonTransaction(const uint256& txid) override
|
||||
|
||||
@@ -141,10 +141,9 @@ public:
|
||||
std::string& fail_reason) = 0;
|
||||
|
||||
//! Commit transaction.
|
||||
virtual bool commitTransaction(CTransactionRef tx,
|
||||
virtual void commitTransaction(CTransactionRef tx,
|
||||
WalletValueMap value_map,
|
||||
WalletOrderForm order_form,
|
||||
std::string& reject_reason) = 0;
|
||||
WalletOrderForm order_form) = 0;
|
||||
|
||||
//! Return whether transaction can be abandoned.
|
||||
virtual bool transactionCanBeAbandoned(const uint256& txid) = 0;
|
||||
|
||||
Reference in New Issue
Block a user