Commit 93454f3
committed
events: add
When processing BOLT12 payments, there was an asymmetry in the API where
payer nodes receive `InvoiceReceived` events but payee nodes had no way
to access the invoices they created and sent.
This commit adds:
- New `Event::InvoiceSent` event generated when a BOLT12 invoice is
created and sent in response to an invoice request
- New `notify_bolt12_invoice_sent` configuration parameter in UserConfig
(defaults to false) to enable/disable the event generation
- Complete serialization/deserialization support for the new event
- Updated tests to handle the new event appropriately
The InvoiceSent event provides the payee with access to:
- The created BOLT12 invoice
- The context of the BlindedMessagePath
- The payment hash and payment secret
This addresses the API asymmetry and provides developers with consistent
access to BOLT12 invoice data on both sides of the transaction, while
maintaining backward compatibility through the opt-in configuration.InvoiceSent event for BOLT12 payee symmetry1 parent 217a5b0 commit 93454f3
File tree
4 files changed
+87
-5
lines changed- lightning/src
- events
- ln
- util
4 files changed
+87
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
968 | 968 | | |
969 | 969 | | |
970 | 970 | | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
971 | 997 | | |
972 | 998 | | |
973 | 999 | | |
| |||
1980 | 2006 | | |
1981 | 2007 | | |
1982 | 2008 | | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
1983 | 2018 | | |
1984 | 2019 | | |
1985 | 2020 | | |
| |||
2539 | 2574 | | |
2540 | 2575 | | |
2541 | 2576 | | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
2542 | 2594 | | |
2543 | 2595 | | |
2544 | 2596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12864 | 12864 | | |
12865 | 12865 | | |
12866 | 12866 | | |
12867 | | - | |
| 12867 | + | |
12868 | 12868 | | |
12869 | 12869 | | |
12870 | 12870 | | |
| |||
12888 | 12888 | | |
12889 | 12889 | | |
12890 | 12890 | | |
12891 | | - | |
| 12891 | + | |
12892 | 12892 | | |
12893 | 12893 | | |
12894 | 12894 | | |
12895 | 12895 | | |
12896 | | - | |
12897 | | - | |
| 12896 | + | |
| 12897 | + | |
| 12898 | + | |
| 12899 | + | |
| 12900 | + | |
| 12901 | + | |
| 12902 | + | |
| 12903 | + | |
| 12904 | + | |
| 12905 | + | |
| 12906 | + | |
| 12907 | + | |
| 12908 | + | |
| 12909 | + | |
| 12910 | + | |
12898 | 12911 | | |
12899 | 12912 | | |
12900 | 12913 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1186 | 1186 | | |
1187 | 1187 | | |
1188 | 1188 | | |
1189 | | - | |
| 1189 | + | |
1190 | 1190 | | |
1191 | 1191 | | |
1192 | 1192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
922 | 937 | | |
923 | 938 | | |
924 | 939 | | |
| |||
936 | 951 | | |
937 | 952 | | |
938 | 953 | | |
| 954 | + | |
939 | 955 | | |
940 | 956 | | |
941 | 957 | | |
| |||
956 | 972 | | |
957 | 973 | | |
958 | 974 | | |
| 975 | + | |
959 | 976 | | |
960 | 977 | | |
961 | 978 | | |
| |||
0 commit comments