param_feerate: parse numbers correctly.

If you used feerate=750, instead of feerate="750" it didn't work, since the
token is not a string.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: JSON RPC: `withdraw` and `txprepare` `feerate` can be a JSON number.
This commit is contained in:
Rusty Russell 2020-07-08 06:20:24 +09:30 committed by Christian Decker
parent a9427f1a8d
commit 972432d285
1 changed files with 1 additions and 1 deletions

View File

@ -355,7 +355,7 @@ struct command_result *param_feerate_val(struct command *cmd,
buffer + base.start);
}
if (json_tok_streq(buffer, &suffix, "")
if (suffix.end == suffix.start
|| json_tok_streq(buffer, &suffix,
feerate_style_name(FEERATE_PER_KBYTE))) {
style = FEERATE_PER_KBYTE;