| 226 | } |
| 227 | |
| 228 | static struct command_result *param_invoice_payment_hash(struct command *cmd, |
| 229 | const char *name, |
| 230 | const char *buffer, |
| 231 | const jsmntok_t *tok, |
| 232 | struct sha256 **hash) |
| 233 | { |
| 234 | struct tlv_invoice *inv; |
| 235 | char *fail; |
| 236 | |
| 237 | inv = invoice_decode(tmpctx, buffer + tok->start, tok->end - tok->start, |
| 238 | plugin_feature_set(cmd->plugin), chainparams, |
| 239 | &fail); |
| 240 | if (!inv) |
| 241 | return command_fail_badparam(cmd, name, buffer, tok, |
| 242 | tal_fmt(cmd, |
| 243 | "Unparsable invoice: %s", |
| 244 | fail)); |
| 245 | |
| 246 | if (!inv->payment_hash) |
| 247 | return command_fail_badparam(cmd, name, buffer, tok, |
| 248 | "invoice missing payment_hash"); |
| 249 | |
| 250 | *hash = tal_steal(cmd, inv->payment_hash); |
| 251 | return NULL; |
| 252 | } |
| 253 | |
| 254 | struct offer_info { |
| 255 | const struct tlv_offer *offer; |
nothing calls this directly
no test coverage detected