aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2019-04-03 17:55:24 -0400
committerJohn Newbery <john@johnnewbery.com>2019-10-18 09:26:32 -0400
commitd1734f9a3b138ab046f38ee44a09bc3847bf938a (patch)
tree172eb76ab4c70e926fe292d8e535cae48ee879fc /src/interfaces
parentb6f486a02b463ffeaf82ec11fc6f74f439c037ae (diff)
[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.
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/wallet.cpp11
-rw-r--r--src/interfaces/wallet.h5
2 files changed, 5 insertions, 11 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp
index aff08bfbea..1830de8a27 100644
--- a/src/interfaces/wallet.cpp
+++ b/src/interfaces/wallet.cpp
@@ -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
diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h
index 89e056b18b..a96b93b4c3 100644
--- a/src/interfaces/wallet.h
+++ b/src/interfaces/wallet.h
@@ -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;