| 151 | } |
| 152 | |
| 153 | bool json_to_sha256(const char *buffer, const jsmntok_t *tok, struct sha256 *dest) |
| 154 | { |
| 155 | if (tok->type != JSMN_STRING) |
| 156 | return false; |
| 157 | |
| 158 | return hex_decode(buffer + tok->start, tok->end - tok->start, dest, |
| 159 | sizeof(struct sha256)); |
| 160 | } |
| 161 | |
| 162 | u8 *json_tok_bin_from_hex(const tal_t *ctx, const char *buffer, const jsmntok_t *tok) |
| 163 | { |