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