Skip to content

Commit

Permalink
Fix bug creating large spark spend tx (#1399)
Browse files Browse the repository at this point in the history
  • Loading branch information
levonpetrosyan93 authored Jan 24, 2024
1 parent 2347fb1 commit 6d2b76c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/spark/sparkwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1525,9 +1525,6 @@ CWalletTx CSparkWallet::CreateSparkSpendTransaction(
i++;
}

// check fee
wtxNew.SetTx(MakeTransactionRef(std::move(tx)));

if (GetTransactionWeight(tx) >= MAX_NEW_TX_WEIGHT) {
throw std::runtime_error(_("Transaction too large"));
}
Expand All @@ -1546,6 +1543,8 @@ CWalletTx CSparkWallet::CreateSparkSpendTransaction(
throw std::invalid_argument(_("Not enough fee estimated"));
}

wtxNew.SetTx(MakeTransactionRef(std::move(tx)));

result.push_back(wtxNew);
}
}
Expand Down

0 comments on commit 6d2b76c

Please sign in to comment.