You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge bitcoin#16521: rpc: Use the default maxfeerate value as BTC/kB
2dfd683 test: Add test for default maxfeerate in sendrawtransaction (Joonmo Yang)
261843e wallet/rpc: Use the default maxfeerate value as BTC/kB (Joonmo Yang)
Pull request description:
Fixesbitcoin#16382
This patch tries to treat `maxfeerate` in sendrawtransaction/testmempoolaccept RPC as a rate(BTC/kB) instead of an absolute value(BTC).
The included test case checks if the new behavior works correctly, by using the transaction with an absolute fee of ~0.02BTC, where the fee rate is ~0.2BTC/kB.
This test should be failing if the default `maxfeerate` is 0.1BTC, but pass if the default value is 0.1BTC/kB
ACKs for top commit:
laanwj:
ACK 2dfd683 (ACKs by Sjors and MarcoFalke above for trivially different code)
Tree-SHA512: a1795bffe8a182acef8844797955db1f60bb0c0ded97148f3572dc265234d5219271a3a7aa0b6418a43f73b2b2720ef7412ba169c99bb1cdcac52051f537d6af
// TODO: temporary migration code for old clients. Remove in v0.20
810
811
if (request.params[1].isBool()) {
811
812
throwJSONRPCError(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.");
812
813
} elseif (!request.params[1].isNull()) {
813
-
size_t weight = GetTransactionWeight(*tx);
814
-
CFeeRate fr(AmountFromValue(request.params[1]));
815
-
// the +3/4 part rounds the value up, and is the same formula used when
// TODO: temporary migration code for old clients. Remove in v0.20
886
885
if (request.params[1].isBool()) {
887
886
throwJSONRPCError(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.");
888
887
} elseif (!request.params[1].isNull()) {
889
-
size_t weight = GetTransactionWeight(*tx);
890
-
CFeeRate fr(AmountFromValue(request.params[1]));
891
-
// the +3/4 part rounds the value up, and is the same formula used when
0 commit comments