json: add a param parser for a txid

This commit is contained in:
lisa neigut
2019-06-05 14:58:53 +09:30
committed by Rusty Russell
parent c40250ad0b
commit a4a193840f
5 changed files with 33 additions and 0 deletions

View File

@@ -68,3 +68,10 @@ bool json_to_short_channel_id(const char *buffer, const jsmntok_t *tok,
tok->end - tok->start, scid,
may_be_deprecated_form));
}
bool json_to_txid(const char *buffer, const jsmntok_t *tok,
struct bitcoin_txid *txid)
{
return bitcoin_txid_from_hex(buffer + tok->start,
tok->end - tok->start, txid);
}