@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
59
59
struct bolt11 * b11 ;
60
60
struct bolt11_field * extra ;
61
61
size_t i ;
62
- char * fail ;
62
+ char * fail , * description = NULL ;
63
63
64
64
err_set_progname (argv [0 ]);
65
65
secp256k1_ctx = secp256k1_context_create (SECP256K1_CONTEXT_VERIFY
@@ -68,6 +68,9 @@ int main(int argc, char *argv[])
68
68
opt_set_alloc (opt_allocfn , tal_reallocfn , tal_freefn );
69
69
opt_register_noarg ("--help|-h" , opt_usage_and_exit ,
70
70
"<decode> <bolt11>" , "Show this message" );
71
+ opt_register_arg ("--hashed-description" , opt_set_charp , opt_show_charp ,
72
+ & description ,
73
+ "Description to check hashed description against" );
71
74
opt_register_version ();
72
75
73
76
opt_early_parse (argc , argv , opt_log_stderr_exit );
@@ -86,7 +89,7 @@ int main(int argc, char *argv[])
86
89
errx (ERROR_USAGE , "Need argument\n%s" ,
87
90
opt_usage (argv [0 ], NULL ));
88
91
89
- b11 = bolt11_decode (ctx , argv [2 ], NULL , & fail );
92
+ b11 = bolt11_decode (ctx , argv [2 ], description , & fail );
90
93
if (!b11 )
91
94
errx (ERROR_BAD_DECODE , "%s" , fail );
92
95
@@ -105,7 +108,7 @@ int main(int argc, char *argv[])
105
108
printf ("description: %s\n" , b11 -> description );
106
109
if (b11 -> description_hash )
107
110
printf ("description_hash: %s\n" ,
108
- tal_hexstr (ctx , b11 -> description ,
111
+ tal_hexstr (ctx , b11 -> description_hash ,
109
112
sizeof (* b11 -> description_hash )));
110
113
111
114
if (tal_len (b11 -> fallback )) {
0 commit comments