nostrdb: bolt11: update to latest version from CLN

Copy the latest, which has parsing fixes.  We make a new explicit
"bolt11_decode_minimal" which doesn't check sigs, rather than neutering
the bolt11_decode logic.

As a bonus, this now correctly parses "LIGHTNING:BECH32..." format
(upper case, with prefix).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
Rusty Russell
2024-08-18 11:28:48 +09:30
committed by Daniel D’Aquino
parent 4d75894bc4
commit 7f2ee78512
3 changed files with 397 additions and 341 deletions

View File

@@ -168,7 +168,7 @@ static int push_invoice_str(struct ndb_content_parser *p, struct ndb_str_block *
struct bolt11 *bolt11;
char *fail;
if (!(bolt11 = bolt11_decode(NULL, str->str, &fail)))
if (!(bolt11 = bolt11_decode_minimal(NULL, str->str, &fail)))
return 0;
start = p->buffer.p;