@@ -1188,23 +1188,6 @@ where
11881188 claim_from_onchain_tx,
11891189 outbound_amount_forwarded_msat,
11901190 } => {
1191- let event = Event :: PaymentForwarded {
1192- prev_channel_id : prev_channel_id. expect ( "prev_channel_id expected for events generated by LDK versions greater than 0.0.107." ) ,
1193- next_channel_id : next_channel_id. expect ( "next_channel_id expected for events generated by LDK versions greater than 0.0.107." ) ,
1194- prev_user_channel_id : prev_user_channel_id. map ( UserChannelId ) ,
1195- next_user_channel_id : next_user_channel_id. map ( UserChannelId ) ,
1196- prev_node_id,
1197- next_node_id,
1198- total_fee_earned_msat,
1199- skimmed_fee_msat,
1200- claim_from_onchain_tx,
1201- outbound_amount_forwarded_msat,
1202- } ;
1203- self . event_queue . add_event ( event) . map_err ( |e| {
1204- log_error ! ( self . logger, "Failed to push to event queue: {}" , e) ;
1205- ReplayEvent ( )
1206- } ) ?;
1207-
12081191 let read_only_network_graph = self . network_graph . read_only ( ) ;
12091192 let nodes = read_only_network_graph. nodes ( ) ;
12101193 let channels = self . channel_manager . list_channels ( ) ;
@@ -1237,14 +1220,13 @@ where
12371220 format ! ( " to {}{}" , node_str( & next_channel_id) , channel_str( & next_channel_id) ) ;
12381221
12391222 let fee_earned = total_fee_earned_msat. unwrap_or ( 0 ) ;
1240- let outbound_amount_forwarded_msat = outbound_amount_forwarded_msat. unwrap_or ( 0 ) ;
12411223 if claim_from_onchain_tx {
12421224 log_info ! (
12431225 self . logger,
12441226 "Forwarded payment{}{} of {}msat, earning {}msat in fees from claiming onchain." ,
12451227 from_prev_str,
12461228 to_next_str,
1247- outbound_amount_forwarded_msat,
1229+ outbound_amount_forwarded_msat. unwrap_or ( 0 ) ,
12481230 fee_earned,
12491231 ) ;
12501232 } else {
@@ -1253,14 +1235,31 @@ where
12531235 "Forwarded payment{}{} of {}msat, earning {}msat in fees." ,
12541236 from_prev_str,
12551237 to_next_str,
1256- outbound_amount_forwarded_msat,
1238+ outbound_amount_forwarded_msat. unwrap_or ( 0 ) ,
12571239 fee_earned,
12581240 ) ;
12591241 }
12601242
12611243 if let Some ( liquidity_source) = self . liquidity_source . as_ref ( ) {
12621244 liquidity_source. handle_payment_forwarded ( next_channel_id) ;
12631245 }
1246+
1247+ let event = Event :: PaymentForwarded {
1248+ prev_channel_id : prev_channel_id. expect ( "prev_channel_id expected for events generated by LDK versions greater than 0.0.107." ) ,
1249+ next_channel_id : next_channel_id. expect ( "next_channel_id expected for events generated by LDK versions greater than 0.0.107." ) ,
1250+ prev_user_channel_id : prev_user_channel_id. map ( UserChannelId ) ,
1251+ next_user_channel_id : next_user_channel_id. map ( UserChannelId ) ,
1252+ prev_node_id,
1253+ next_node_id,
1254+ total_fee_earned_msat,
1255+ skimmed_fee_msat,
1256+ claim_from_onchain_tx,
1257+ outbound_amount_forwarded_msat,
1258+ } ;
1259+ self . event_queue . add_event ( event) . map_err ( |e| {
1260+ log_error ! ( self . logger, "Failed to push to event queue: {}" , e) ;
1261+ ReplayEvent ( )
1262+ } ) ?;
12641263 } ,
12651264 LdkEvent :: ChannelPending {
12661265 channel_id,
0 commit comments