|
39 | 39 |
|
40 | 40 | #include <univalue.h>
|
41 | 41 |
|
| 42 | +constexpr static CAmount DEFAULT_MAX_RAW_TX_FEE{COIN / 10}; |
42 | 43 |
|
43 | 44 | static void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
|
44 | 45 | {
|
@@ -1038,7 +1039,7 @@ static UniValue sendrawtransaction(const JSONRPCRequest& request)
|
1038 | 1039 | "\nAlso see createrawtransaction and signrawtransactionwithkey calls.\n",
|
1039 | 1040 | {
|
1040 | 1041 | {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex string of the raw transaction"},
|
1041 |
| - {"maxfeerate", RPCArg::Type::AMOUNT, /* default */ FormatMoney(maxTxFee), "Reject transactions whose fee rate is higher than the specified value, expressed in " + CURRENCY_UNIT + "/kB\n"}, |
| 1042 | + {"maxfeerate", RPCArg::Type::AMOUNT, /* default */ FormatMoney(DEFAULT_MAX_RAW_TX_FEE), "Reject transactions whose fee rate is higher than the specified value, expressed in " + CURRENCY_UNIT + "/kB\n"}, |
1042 | 1043 | },
|
1043 | 1044 | RPCResult{
|
1044 | 1045 | "\"hex\" (string) The transaction hash in hex\n"
|
@@ -1070,7 +1071,7 @@ static UniValue sendrawtransaction(const JSONRPCRequest& request)
|
1070 | 1071 | throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
1071 | 1072 | CTransactionRef tx(MakeTransactionRef(std::move(mtx)));
|
1072 | 1073 |
|
1073 |
| - CAmount max_raw_tx_fee = maxTxFee; |
| 1074 | + CAmount max_raw_tx_fee = DEFAULT_MAX_RAW_TX_FEE; |
1074 | 1075 | // TODO: temporary migration code for old clients. Remove in v0.20
|
1075 | 1076 | if (request.params[1].isBool()) {
|
1076 | 1077 | throw JSONRPCError(RPC_INVALID_PARAMETER, "Second argument must be numeric (maxfeerate) and no longer supports a boolean. To allow a transaction with high fees, set maxfeerate to 0.");
|
@@ -1108,7 +1109,7 @@ static UniValue testmempoolaccept(const JSONRPCRequest& request)
|
1108 | 1109 | {"rawtx", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, ""},
|
1109 | 1110 | },
|
1110 | 1111 | },
|
1111 |
| - {"maxfeerate", RPCArg::Type::AMOUNT, /* default */ FormatMoney(maxTxFee), "Reject transactions whose fee rate is higher than the specified value, expressed in " + CURRENCY_UNIT + "/kB\n"}, |
| 1112 | + {"maxfeerate", RPCArg::Type::AMOUNT, /* default */ FormatMoney(DEFAULT_MAX_RAW_TX_FEE), "Reject transactions whose fee rate is higher than the specified value, expressed in " + CURRENCY_UNIT + "/kB\n"}, |
1112 | 1113 | },
|
1113 | 1114 | RPCResult{
|
1114 | 1115 | "[ (array) The result of the mempool acceptance test for each raw transaction in the input array.\n"
|
@@ -1152,7 +1153,7 @@ static UniValue testmempoolaccept(const JSONRPCRequest& request)
|
1152 | 1153 | CTransactionRef tx(MakeTransactionRef(std::move(mtx)));
|
1153 | 1154 | const uint256& tx_hash = tx->GetHash();
|
1154 | 1155 |
|
1155 |
| - CAmount max_raw_tx_fee = maxTxFee; |
| 1156 | + CAmount max_raw_tx_fee = DEFAULT_MAX_RAW_TX_FEE; |
1156 | 1157 | // TODO: temporary migration code for old clients. Remove in v0.20
|
1157 | 1158 | if (request.params[1].isBool()) {
|
1158 | 1159 | throw JSONRPCError(RPC_INVALID_PARAMETER, "Second argument must be numeric (maxfeerate) and no longer supports a boolean. To allow a transaction with high fees, set maxfeerate to 0.");
|
|
0 commit comments