diff options
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 9 | ||||
-rw-r--r-- | src/rpc/util.cpp | 1 | ||||
-rw-r--r-- | src/rpc/util.h | 1 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 38e2dc237e..5a714a137e 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1065,10 +1065,11 @@ static UniValue sendrawtransaction(const JSONRPCRequest& request) bool allowhighfees = false; if (!request.params[1].isNull()) allowhighfees = request.params[1].get_bool(); + const CAmount highfee{allowhighfees ? 0 : ::maxTxFee}; uint256 txid; - TransactionError err; std::string err_string; - if (!BroadcastTransaction(tx, txid, err, err_string, allowhighfees)) { + const TransactionError err = BroadcastTransaction(tx, txid, err_string, highfee); + if (TransactionError::OK != err) { throw JSONRPCTransactionError(err, err_string); } @@ -1493,8 +1494,8 @@ UniValue combinepsbt(const JSONRPCRequest& request) } PartiallySignedTransaction merged_psbt; - TransactionError error; - if (!CombinePSBTs(merged_psbt, error, psbtxs)) { + const TransactionError error = CombinePSBTs(merged_psbt, psbtxs); + if (error != TransactionError::OK) { throw JSONRPCTransactionError(error); } diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index e37af953fa..86695bc1a5 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -5,7 +5,6 @@ #include <key_io.h> #include <keystore.h> #include <policy/fees.h> -#include <rpc/protocol.h> #include <rpc/util.h> #include <tinyformat.h> #include <util/strencodings.h> diff --git a/src/rpc/util.h b/src/rpc/util.h index 7b8dd5a9ec..06800ad63c 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -7,6 +7,7 @@ #include <node/transaction.h> #include <pubkey.h> +#include <rpc/protocol.h> #include <script/standard.h> #include <univalue.h> |