mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09: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:
@@ -394,11 +394,7 @@ Result CommitTransaction(CWallet& wallet, const uint256& txid, CMutableTransacti
|
||||
mapValue["replaces_txid"] = oldWtx.GetHash().ToString();
|
||||
|
||||
CValidationState state;
|
||||
if (!wallet.CommitTransaction(tx, std::move(mapValue), oldWtx.vOrderForm, state)) {
|
||||
// NOTE: CommitTransaction never returns false, so this should never happen.
|
||||
errors.push_back(strprintf("The transaction was rejected: %s", FormatStateMessage(state)));
|
||||
return Result::WALLET_ERROR;
|
||||
}
|
||||
wallet.CommitTransaction(tx, std::move(mapValue), oldWtx.vOrderForm, state);
|
||||
|
||||
bumped_txid = tx->GetHash();
|
||||
if (state.IsInvalid()) {
|
||||
|
||||
Reference in New Issue
Block a user