| 944 | } |
| 945 | |
| 946 | static RPCHelpMan bumpfee_helper(std::string method_name) |
| 947 | { |
| 948 | const bool want_psbt = method_name == "psbtbumpfee"; |
| 949 | const std::string incremental_fee{CFeeRate(DEFAULT_INCREMENTAL_RELAY_FEE).ToString(FeeEstimateMode::SAT_VB)}; |
| 950 | |
| 951 | return RPCHelpMan{method_name, |
| 952 | "\nBumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.\n" |
| 953 | + std::string(want_psbt ? "Returns a PSBT instead of creating and signing a new transaction.\n" : "") + |
| 954 | "An opt-in RBF transaction with the given txid must be in the wallet.\n" |
| 955 | "The command will pay the additional fee by reducing change outputs or adding inputs when necessary.\n" |
| 956 | "It may add a new change output if one does not already exist.\n" |
| 957 | "All inputs in the original transaction will be included in the replacement transaction.\n" |
| 958 | "The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\n" |
| 959 | "By default, the new fee will be calculated automatically using the estimatesmartfee RPC.\n" |
| 960 | "The user can specify a confirmation target for estimatesmartfee.\n" |
| 961 | "Alternatively, the user can specify a fee rate in " + CURRENCY_ATOM + "/vB for the new transaction.\n" |
| 962 | "At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee\n" |
| 963 | "returned by getnetworkinfo) to enter the node's mempool.\n" |
| 964 | "* WARNING: before version 0.21, fee_rate was in " + CURRENCY_UNIT + "/kvB. As of 0.21, fee_rate is in " + CURRENCY_ATOM + "/vB. *\n", |
| 965 | { |
| 966 | {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The txid to be bumped"}, |
| 967 | {"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "", |
| 968 | { |
| 969 | {"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks\n"}, |
| 970 | {"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, |
| 971 | "\nSpecify a fee rate in " + CURRENCY_ATOM + "/vB instead of relying on the built-in fee estimator.\n" |
| 972 | "Must be at least " + incremental_fee + " higher than the current transaction fee rate.\n" |
| 973 | "WARNING: before version 0.21, fee_rate was in " + CURRENCY_UNIT + "/kvB. As of 0.21, fee_rate is in " + CURRENCY_ATOM + "/vB.\n"}, |
| 974 | {"replaceable", RPCArg::Type::BOOL, RPCArg::Default{true}, "Whether the new transaction should still be\n" |
| 975 | "marked bip-125 replaceable. If true, the sequence numbers in the transaction will\n" |
| 976 | "be left unchanged from the original. If false, any input sequence numbers in the\n" |
| 977 | "original transaction that were less than 0xfffffffe will be increased to 0xfffffffe\n" |
| 978 | "so the new transaction will not be explicitly bip-125 replaceable (though it may\n" |
| 979 | "still be replaceable in practice, for example if it has unconfirmed ancestors which\n" |
| 980 | "are replaceable).\n"}, |
| 981 | {"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n" |
| 982 | "\"" + FeeModes("\"\n\"") + "\""}, |
| 983 | }, |
| 984 | "options"}, |
| 985 | }, |
| 986 | RPCResult{ |
| 987 | RPCResult::Type::OBJ, "", "", Cat( |
| 988 | want_psbt ? |
| 989 | std::vector<RPCResult>{{RPCResult::Type::STR, "psbt", "The base64-encoded unsigned PSBT of the new transaction."}} : |
| 990 | std::vector<RPCResult>{{RPCResult::Type::STR_HEX, "txid", "The id of the new transaction."}}, |
| 991 | { |
| 992 | {RPCResult::Type::STR_AMOUNT, "origfee", "The fee of the replaced transaction."}, |
| 993 | {RPCResult::Type::STR_AMOUNT, "fee", "The fee of the new transaction."}, |
| 994 | {RPCResult::Type::ARR, "errors", "Errors encountered during processing (may be empty).", |
| 995 | { |
| 996 | {RPCResult::Type::STR, "", ""}, |
| 997 | }}, |
| 998 | }) |
| 999 | }, |
| 1000 | RPCExamples{ |
| 1001 | "\nBump the fee, get the new transaction\'s " + std::string(want_psbt ? "psbt" : "txid") + "\n" + |
| 1002 | HelpExampleCli(method_name, "<txid>") |
| 1003 | }, |
no test coverage detected