mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
plugins/bcli.c: sendrawtransaction now has a required allowhighfees argument.
Changelog-Deprecated: plugin: `bcli` replacements should note that `sendrawtransaction` now has a second required Boolean argument, `allowhighfees`, which if `true`, means ignore any fee limits and just broadcast the transaction. Use `--deprecated-apis` to use older `bcli` replacement plugins that only support a single argument.
This commit is contained in:
committed by
Rusty Russell
parent
12c9b27838
commit
ee276bcb86
@@ -753,13 +753,29 @@ static struct command_result *sendrawtransaction(struct command *cmd,
|
||||
const jsmntok_t *toks)
|
||||
{
|
||||
const char **params = tal_arr(cmd, const char *, 1);
|
||||
bool *allowhighfees;
|
||||
|
||||
/* bitcoin-cli wants strings. */
|
||||
if (!param(cmd, buf, toks,
|
||||
p_req("tx", param_string, ¶ms[0]),
|
||||
p_req("allowhighfees", param_bool, &allowhighfees),
|
||||
NULL))
|
||||
return command_param_failed();
|
||||
|
||||
if (*allowhighfees) {
|
||||
if (bitcoind->version >= 190001)
|
||||
/* Starting in 19.0.1, second argument is
|
||||
* maxfeerate, which when set to 0 means
|
||||
* no max feerate.
|
||||
*/
|
||||
tal_arr_expand(¶ms, "0");
|
||||
else
|
||||
/* in older versions, second arg is allowhighfees,
|
||||
* set to true to allow high fees.
|
||||
*/
|
||||
tal_arr_expand(¶ms, "true");
|
||||
}
|
||||
|
||||
start_bitcoin_cli(NULL, cmd, process_sendrawtransaction, true,
|
||||
BITCOIND_HIGH_PRIO, "sendrawtransaction", params, NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user