Skip to content

Commit

Permalink
refactor: Change Chain::broadcastTransaction param order
Browse files Browse the repository at this point in the history
Summary:
Make output argument last argument so it works more easily with IPC framework
in #10102, and for consistency with other methods

Backport of Core [[bitcoin/bitcoin#18278 | PR18278]] part [4/6] : bitcoin/bitcoin@96dfe5c

Depends on D8021

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8022
  • Loading branch information
ryanofsky authored and deadalnix committed Oct 21, 2020
1 parent a44de4c commit ba43817
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/interfaces/chain.cpp
Expand Up @@ -326,9 +326,8 @@ namespace {
}
bool broadcastTransaction(const Config &config,
const CTransactionRef &tx,
std::string &err_string,
const Amount &max_tx_fee,
bool relay) override {
const Amount &max_tx_fee, bool relay,
std::string &err_string) override {
const TransactionError err = BroadcastTransaction(
m_node, config, tx, err_string, max_tx_fee, relay,
/*wait_callback*/ false);
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/chain.h
Expand Up @@ -208,8 +208,8 @@ class Chain {
//! the fee or for another reason.
virtual bool broadcastTransaction(const Config &config,
const CTransactionRef &tx,
std::string &err_string,
const Amount &max_tx_fee, bool relay) = 0;
const Amount &max_tx_fee, bool relay,
std::string &err_string) = 0;

//! Calculate mempool ancestor and descendant counts for the given
//! transaction.
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Expand Up @@ -1937,7 +1937,7 @@ bool CWalletTx::SubmitMemoryPoolAndRelay(std::string &err_string, bool relay) {
// out-of-order is incorrect - it should be unmarked when
// TransactionRemovedFromMempool fires.
bool ret = pwallet->chain().broadcastTransaction(
GetConfig(), tx, err_string, pwallet->m_default_max_tx_fee, relay);
GetConfig(), tx, pwallet->m_default_max_tx_fee, relay, err_string);
fInMempool |= ret;
return ret;
}
Expand Down

0 comments on commit ba43817

Please sign in to comment.