feerate: allow names 'urgent' 'normal' and 'slow'.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-29 06:16:34 +09:30
committed by Christian Decker
parent e0952ceff2
commit db3c387264
10 changed files with 63 additions and 17 deletions

View File

@@ -266,6 +266,11 @@ bool json_tok_feerate(struct command *cmd, const char *name,
enum feerate_style style;
unsigned int num;
for (size_t i = 0; i < NUM_FEERATES; i++) {
if (json_tok_streq(buffer, tok, feerate_name(i)))
return json_feerate_estimate(cmd, feerate, i);
}
/* We have to split the number and suffix. */
suffix.start = suffix.end;
while (suffix.start > base.start && !isdigit(buffer[suffix.start-1])) {