@@ -176,6 +176,45 @@ void notify_custommsg(struct lightningd *ld,
176176 notify_send (ld , n );
177177}
178178
179+ static void onionmessage_forward_fail_serialize (struct json_stream * stream ,
180+ const struct node_id * source ,
181+ const u8 * incoming ,
182+ const struct pubkey * path_key ,
183+ const u8 * outgoing ,
184+ const struct sciddir_or_pubkey * next_node )
185+ {
186+ json_add_node_id (stream , "source" , source );
187+ json_add_hex_talarr (stream , "incoming" , incoming );
188+ json_add_pubkey (stream , "path_key" , path_key );
189+ if (tal_count (outgoing ) != 0 ) {
190+ json_add_hex_talarr (stream , "outgoing" , outgoing );
191+ if (next_node -> is_pubkey )
192+ json_add_pubkey (stream , "next_node_id" , & next_node -> pubkey );
193+ else
194+ json_add_short_channel_id_dir (stream , "next_short_channel_id_dir" ,
195+ next_node -> scidd );
196+ }
197+ }
198+
199+ REGISTER_NOTIFICATION (onionmessage_forward_fail );
200+
201+ void notify_onionmessage_forward_fail (struct lightningd * ld ,
202+ const struct node_id * source ,
203+ const u8 * incoming ,
204+ const struct pubkey * path_key ,
205+ const u8 * outgoing ,
206+ const struct sciddir_or_pubkey * next_node )
207+ {
208+ struct jsonrpc_notification * n = notify_start ("onionmessage_forward_fail" );
209+ onionmessage_forward_fail_serialize (n -> stream ,
210+ source ,
211+ incoming ,
212+ path_key ,
213+ outgoing ,
214+ next_node );
215+ notify_send (ld , n );
216+ }
217+
179218static void invoice_payment_notification_serialize (struct json_stream * stream ,
180219 struct amount_msat amount ,
181220 const struct preimage * preimage ,
0 commit comments