aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2020-10-14 11:57:43 +0800
committerfanquake <fanquake@gmail.com>2020-10-14 12:19:42 +0800
commite21b824386bf9befdab44a60c9f58a450147739e (patch)
tree1e97078c7a6a1936f18d8e22c05f7076f1f62aaa /src
parentec0453cd57736df33e9f50c004d88bea10428ad5 (diff)
parent88197b0769770913941a3361bff3a1c67a86f7d2 (diff)
Merge #20109: Release notes and followups from 19339
88197b0769770913941a3361bff3a1c67a86f7d2 [doc] release notes for max fee checking (gzhao408) c201d73df3602dac75573a0ec3fe4c86bbc02585 style and nits for fee-checking in BroadcastTransaction (gzhao408) Pull request description: Pretty trivial... addresses some tiny comments from #19339. Also fixes a docs typo from #19940 and adds a release note about the error message change for testmempoolaccept. ACKs for top commit: achow101: ACK 88197b0769770913941a3361bff3a1c67a86f7d2 MarcoFalke: cr re-ACK 88197b0769770913941a3361bff3a1c67a86f7d2 Tree-SHA512: fff16d731426b9b4db5222df02633983402f4c7241551eec98bb1554145dbdc132f40ed8ca4abd5edcebe1f4d1e879fb6d11bd91730604f6552c10cdf65706a1
Diffstat (limited to 'src')
-rw-r--r--src/node/transaction.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp
index b72f7b70e9..97d5aad8e4 100644
--- a/src/node/transaction.cpp
+++ b/src/node/transaction.cpp
@@ -13,7 +13,8 @@
#include <future>
-static TransactionError HandleATMPError(const TxValidationState& state, std::string& err_string_out) {
+static TransactionError HandleATMPError(const TxValidationState& state, std::string& err_string_out)
+{
err_string_out = state.ToString();
if (state.IsInvalid()) {
if (state.GetResult() == TxValidationResult::TX_MISSING_INPUTS) {
@@ -50,10 +51,10 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
if (!node.mempool->exists(hashTx)) {
// Transaction is not already in the mempool.
TxValidationState state;
- CAmount fee{0};
- if (max_tx_fee) {
+ if (max_tx_fee > 0) {
// First, call ATMP with test_accept and check the fee. If ATMP
// fails here, return error immediately.
+ CAmount fee{0};
if (!AcceptToMemoryPool(*node.mempool, state, tx,
nullptr /* plTxnReplaced */, false /* bypass_limits */, /* test_accept */ true, &fee)) {
return HandleATMPError(state, err_string);