API: txprepare now support mutiple outputs

This commit is contained in:
trueptolemy
2019-08-16 01:41:23 +08:00
committed by neil saitug
parent 0ab3817715
commit cdcafdaf74
14 changed files with 213 additions and 62 deletions

View File

@@ -60,6 +60,16 @@ bool json_to_sat(const char *buffer, const jsmntok_t *tok,
return parse_amount_sat(sat, buffer + tok->start, tok->end - tok->start);
}
bool json_to_sat_or_all(const char *buffer, const jsmntok_t *tok,
struct amount_sat *sat)
{
if (json_tok_streq(buffer, tok, "all")) {
*sat = AMOUNT_SAT(-1ULL);
return true;
}
return json_to_sat(buffer, tok, sat);
}
bool json_to_short_channel_id(const char *buffer, const jsmntok_t *tok,
struct short_channel_id *scid,
bool may_be_deprecated_form)