Skip to content

Commit c201d73

Browse files
committed
style and nits for fee-checking in BroadcastTransaction
1 parent b337bd7 commit c201d73

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/node/transaction.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
#include <future>
1515

16-
static TransactionError HandleATMPError(const TxValidationState& state, std::string& err_string_out) {
16+
static TransactionError HandleATMPError(const TxValidationState& state, std::string& err_string_out)
17+
{
1718
err_string_out = state.ToString();
1819
if (state.IsInvalid()) {
1920
if (state.GetResult() == TxValidationResult::TX_MISSING_INPUTS) {
@@ -50,10 +51,10 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
5051
if (!node.mempool->exists(hashTx)) {
5152
// Transaction is not already in the mempool.
5253
TxValidationState state;
53-
CAmount fee{0};
54-
if (max_tx_fee) {
54+
if (max_tx_fee > 0) {
5555
// First, call ATMP with test_accept and check the fee. If ATMP
5656
// fails here, return error immediately.
57+
CAmount fee{0};
5758
if (!AcceptToMemoryPool(*node.mempool, state, tx,
5859
nullptr /* plTxnReplaced */, false /* bypass_limits */, /* test_accept */ true, &fee)) {
5960
return HandleATMPError(state, err_string);

0 commit comments

Comments
 (0)