| 128 | } |
| 129 | |
| 130 | bool json_to_sha256(const char *buffer, const jsmntok_t *tok, struct sha256 *dest) |
| 131 | { |
| 132 | if (tok->type != JSMN_STRING) |
| 133 | return false; |
| 134 | |
| 135 | return hex_decode(buffer + tok->start, tok->end - tok->start, dest, |
| 136 | sizeof(struct sha256)); |
| 137 | } |
| 138 | |
| 139 | u8 *json_tok_bin_from_hex(const tal_t *ctx, const char *buffer, const jsmntok_t *tok) |
| 140 | { |