We rely on label forms for uniqueness. */
| 147 | |
| 148 | /* We rely on label forms for uniqueness. */ |
| 149 | static void json_add_label(struct json_stream *js, |
| 150 | const struct sha256 *offer_id, |
| 151 | const struct pubkey *payer_key, |
| 152 | const u32 counter) |
| 153 | { |
| 154 | char *label; |
| 155 | |
| 156 | label = tal_fmt(tmpctx, "%s-%s-%u", |
| 157 | fmt_sha256(tmpctx, offer_id), |
| 158 | fmt_pubkey(tmpctx, payer_key), |
| 159 | counter); |
| 160 | json_add_string(js, "label", label); |
| 161 | } |
| 162 | |
| 163 | /* Note: this can actually happen if a single-use offer is already |
| 164 | * used at the same time between the check and now. |
no test coverage detected