FIXME: This is a hack. The real secret should be a signature of some * onion key, using the payer_id */
| 144 | /* FIXME: This is a hack. The real secret should be a signature of some |
| 145 | * onion key, using the payer_id */ |
| 146 | static void invoice_secret_bolt12(struct lightningd *ld, |
| 147 | const char *invstring, |
| 148 | struct secret *payment_secret) |
| 149 | { |
| 150 | char *fail; |
| 151 | struct tlv_invoice *inv; |
| 152 | struct sha256 merkle; |
| 153 | |
| 154 | inv = invoice_decode(tmpctx, invstring, strlen(invstring), |
| 155 | NULL, NULL, &fail); |
| 156 | if (!inv) { |
| 157 | log_broken(ld->log, "Unable to decode our invoice %s", |
| 158 | invstring); |
| 159 | return; |
| 160 | } |
| 161 | |
| 162 | merkle_tlv(inv->fields, &merkle); |
| 163 | BUILD_ASSERT(sizeof(*payment_secret) == sizeof(merkle)); |
| 164 | memcpy(payment_secret, &merkle, sizeof(merkle)); |
| 165 | } |
| 166 | |
| 167 | struct invoice_payment_hook_payload { |
| 168 | struct lightningd *ld; |
no test coverage detected