@@ -1170,23 +1170,6 @@ where
11701170 claim_from_onchain_tx,
11711171 outbound_amount_forwarded_msat,
11721172 } => {
1173- let event = Event :: PaymentForwarded {
1174- prev_channel_id : prev_channel_id. expect ( "prev_channel_id expected for events generated by LDK versions greater than 0.0.107." ) ,
1175- next_channel_id : next_channel_id. expect ( "next_channel_id expected for events generated by LDK versions greater than 0.0.107." ) ,
1176- prev_user_channel_id : prev_user_channel_id. map ( UserChannelId ) ,
1177- next_user_channel_id : next_user_channel_id. map ( UserChannelId ) ,
1178- prev_node_id,
1179- next_node_id,
1180- total_fee_earned_msat,
1181- skimmed_fee_msat,
1182- claim_from_onchain_tx,
1183- outbound_amount_forwarded_msat,
1184- } ;
1185- self . event_queue . add_event ( event) . map_err ( |e| {
1186- log_error ! ( self . logger, "Failed to push to event queue: {}" , e) ;
1187- ReplayEvent ( )
1188- } ) ?;
1189-
11901173 let read_only_network_graph = self . network_graph . read_only ( ) ;
11911174 let nodes = read_only_network_graph. nodes ( ) ;
11921175 let channels = self . channel_manager . list_channels ( ) ;
@@ -1219,14 +1202,13 @@ where
12191202 format ! ( " to {}{}" , node_str( & next_channel_id) , channel_str( & next_channel_id) ) ;
12201203
12211204 let fee_earned = total_fee_earned_msat. unwrap_or ( 0 ) ;
1222- let outbound_amount_forwarded_msat = outbound_amount_forwarded_msat. unwrap_or ( 0 ) ;
12231205 if claim_from_onchain_tx {
12241206 log_info ! (
12251207 self . logger,
12261208 "Forwarded payment{}{} of {}msat, earning {}msat in fees from claiming onchain." ,
12271209 from_prev_str,
12281210 to_next_str,
1229- outbound_amount_forwarded_msat,
1211+ outbound_amount_forwarded_msat. unwrap_or ( 0 ) ,
12301212 fee_earned,
12311213 ) ;
12321214 } else {
@@ -1235,14 +1217,31 @@ where
12351217 "Forwarded payment{}{} of {}msat, earning {}msat in fees." ,
12361218 from_prev_str,
12371219 to_next_str,
1238- outbound_amount_forwarded_msat,
1220+ outbound_amount_forwarded_msat. unwrap_or ( 0 ) ,
12391221 fee_earned,
12401222 ) ;
12411223 }
12421224
12431225 if let Some ( liquidity_source) = self . liquidity_source . as_ref ( ) {
12441226 liquidity_source. handle_payment_forwarded ( next_channel_id) ;
12451227 }
1228+
1229+ let event = Event :: PaymentForwarded {
1230+ prev_channel_id : prev_channel_id. expect ( "prev_channel_id expected for events generated by LDK versions greater than 0.0.107." ) ,
1231+ next_channel_id : next_channel_id. expect ( "next_channel_id expected for events generated by LDK versions greater than 0.0.107." ) ,
1232+ prev_user_channel_id : prev_user_channel_id. map ( UserChannelId ) ,
1233+ next_user_channel_id : next_user_channel_id. map ( UserChannelId ) ,
1234+ prev_node_id,
1235+ next_node_id,
1236+ total_fee_earned_msat,
1237+ skimmed_fee_msat,
1238+ claim_from_onchain_tx,
1239+ outbound_amount_forwarded_msat,
1240+ } ;
1241+ self . event_queue . add_event ( event) . map_err ( |e| {
1242+ log_error ! ( self . logger, "Failed to push to event queue: {}" , e) ;
1243+ ReplayEvent ( )
1244+ } ) ?;
12461245 } ,
12471246 LdkEvent :: ChannelPending {
12481247 channel_id,
0 commit comments