offers: signatures are now optional.

As per latest spec revision.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: BOLT12 offers can now be unsigned, for really short QR codes.
This commit is contained in:
Rusty Russell
2021-07-02 09:41:34 +09:30
parent 6336d39a95
commit f9fe814ea3
20 changed files with 130 additions and 61 deletions

View File

@@ -481,8 +481,8 @@ int main(int argc, char *argv[])
if (streq(hrp, "lno")) {
const struct tlv_offer *offer
= offer_decode_nosig(ctx, argv[2], strlen(argv[2]),
NULL, NULL, &fail);
= offer_decode(ctx, argv[2], strlen(argv[2]),
NULL, NULL, &fail);
if (!offer)
errx(ERROR_BAD_DECODE, "Bad offer: %s", fail);
@@ -517,7 +517,7 @@ int main(int argc, char *argv[])
print_features(offer->features);
if (offer->paths)
print_blindedpaths(offer->paths, NULL);
if (must_have(offer, signature) && offer->node_id)
if (offer->signature && offer->node_id)
well_formed &= print_signature("offer", "signature",
offer->fields,
offer->node_id,