@@ -1318,7 +1318,7 @@ impl<Signer: Sign> Channel<Signer> {
1318
1318
///
1319
1319
/// Note that it is still possible to hit these assertions in case we find a preimage on-chain
1320
1320
/// but then have a reorg which settles on an HTLC-failure on chain.
1321
- pub fn get_update_fail_htlc ( & mut self , htlc_id_arg : u64 , err_packet : msgs:: OnionErrorPacket ) -> Result < Option < msgs:: UpdateFailHTLC > , ChannelError > {
1321
+ pub fn get_update_fail_htlc < L : Deref > ( & mut self , htlc_id_arg : u64 , err_packet : msgs:: OnionErrorPacket , logger : & L ) -> Result < Option < msgs:: UpdateFailHTLC > , ChannelError > where L :: Target : Logger {
1322
1322
if ( self . channel_state & ( ChannelState :: ChannelFunded as u32 ) ) != ( ChannelState :: ChannelFunded as u32 ) {
1323
1323
panic ! ( "Was asked to fail an HTLC when channel was not in an operational state" ) ;
1324
1324
}
@@ -1368,13 +1368,15 @@ impl<Signer: Sign> Channel<Signer> {
1368
1368
_ => { }
1369
1369
}
1370
1370
}
1371
+ log_trace ! ( logger, "Placing failure for HTLC ID {} in holding cell" , htlc_id_arg) ;
1371
1372
self . holding_cell_htlc_updates . push ( HTLCUpdateAwaitingACK :: FailHTLC {
1372
1373
htlc_id : htlc_id_arg,
1373
1374
err_packet,
1374
1375
} ) ;
1375
1376
return Ok ( None ) ;
1376
1377
}
1377
1378
1379
+ log_trace ! ( logger, "Failure HTLC ID {} back with a update_fail_htlc message" , htlc_id_arg) ;
1378
1380
{
1379
1381
let htlc = & mut self . pending_inbound_htlcs [ pending_idx] ;
1380
1382
htlc. state = InboundHTLCState :: LocalRemoved ( InboundHTLCRemovalReason :: FailRelay ( err_packet. clone ( ) ) ) ;
@@ -2366,7 +2368,7 @@ impl<Signer: Sign> Channel<Signer> {
2366
2368
}
2367
2369
} ,
2368
2370
& HTLCUpdateAwaitingACK :: FailHTLC { htlc_id, ref err_packet } => {
2369
- match self . get_update_fail_htlc ( htlc_id, err_packet. clone ( ) ) {
2371
+ match self . get_update_fail_htlc ( htlc_id, err_packet. clone ( ) , logger ) {
2370
2372
Ok ( update_fail_msg_option) => update_fail_htlcs. push ( update_fail_msg_option. unwrap ( ) ) ,
2371
2373
Err ( e) => {
2372
2374
if let ChannelError :: Ignore ( _) = e { }
0 commit comments