We rely on label forms for uniqueness. */
| 135 | |
| 136 | /* We rely on label forms for uniqueness. */ |
| 137 | static void json_add_label(struct json_stream *js, |
| 138 | const struct sha256 *offer_id, |
| 139 | const struct point32 *payer_key, |
| 140 | const u32 counter) |
| 141 | { |
| 142 | char *label; |
| 143 | |
| 144 | label = tal_fmt(tmpctx, "%s-%s-%u", |
| 145 | type_to_string(tmpctx, struct sha256, offer_id), |
| 146 | type_to_string(tmpctx, struct point32, |
| 147 | payer_key), |
| 148 | counter); |
| 149 | json_add_string(js, "label", label); |
| 150 | } |
| 151 | |
| 152 | /* Note: this can actually happen if a single-use offer is already |
| 153 | * used at the same time between the check and now. |
no test coverage detected