MCPcopy Create free account
hub / github.com/ElementsProject/lightning / param_feerate_range

Function param_feerate_range

lightningd/closing_control.c:664–693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

662}
663
664static struct command_result *param_feerate_range(struct command *cmd,
665 const char *name,
666 const char *buffer,
667 const jsmntok_t *tok,
668 u32 **feerate_range)
669{
670 struct command_result *ret;
671 u32 *rate;
672
673 *feerate_range = tal_arr(cmd, u32, 2);
674 if (tok->type != JSMN_ARRAY || tok->size != 2)
675 return command_fail_badparam(cmd, name, buffer, tok,
676 "should be an array of 2 entries");
677
678 ret = param_feerate(cmd, name, buffer, tok+1, &rate);
679 if (ret)
680 return ret;
681 (*feerate_range)[0] = *rate;
682 ret = param_feerate(cmd, name, buffer, tok+2, &rate);
683 if (ret)
684 return ret;
685 (*feerate_range)[1] = *rate;
686
687 /* closingd would silently lower min to max, but we check the
688 * peer's closing tx against min: don't let them disagree. */
689 if ((*feerate_range)[0] > (*feerate_range)[1])
690 return command_fail_badparam(cmd, name, buffer, tok,
691 "minimum feerate must not exceed maximum");
692 return NULL;
693}
694
695/* Only one of these will be set! */
696struct some_channel {

Callers

nothing calls this directly

Calls 2

param_feerateFunction · 0.85
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected