The unique id is embedded with a special restriction with an empty field name */
| 252 | |
| 253 | /* The unique id is embedded with a special restriction with an empty field name */ |
| 254 | static bool is_unique_id(struct rune_restr **restrs, unsigned int index) |
| 255 | { |
| 256 | /* must be the first restriction */ |
| 257 | if (index != 0) |
| 258 | return false; |
| 259 | |
| 260 | /* Must be the only alternative */ |
| 261 | if (tal_count(restrs[index]->alterns) != 1) |
| 262 | return false; |
| 263 | |
| 264 | /* Must have an empty field name */ |
| 265 | return streq(restrs[index]->alterns[0]->fieldname, ""); |
| 266 | } |
| 267 | |
| 268 | static char *fmt_cond(const tal_t *ctx, |
| 269 | const struct rune_altern *alt, |