@@ -1329,7 +1329,7 @@ impl<Signer: Sign> Channel<Signer> {
1329
1329
///
1330
1330
/// Note that it is still possible to hit these assertions in case we find a preimage on-chain
1331
1331
/// but then have a reorg which settles on an HTLC-failure on chain.
1332
- pub fn get_update_fail_htlc ( & mut self , htlc_id_arg : u64 , err_packet : msgs:: OnionErrorPacket ) -> Result < Option < msgs:: UpdateFailHTLC > , ChannelError > {
1332
+ 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 {
1333
1333
if ( self . channel_state & ( ChannelState :: ChannelFunded as u32 ) ) != ( ChannelState :: ChannelFunded as u32 ) {
1334
1334
panic ! ( "Was asked to fail an HTLC when channel was not in an operational state" ) ;
1335
1335
}
@@ -1379,13 +1379,15 @@ impl<Signer: Sign> Channel<Signer> {
1379
1379
_ => { }
1380
1380
}
1381
1381
}
1382
+ log_trace ! ( logger, "Placing failure for HTLC ID {} in holding cell" , htlc_id_arg) ;
1382
1383
self . holding_cell_htlc_updates . push ( HTLCUpdateAwaitingACK :: FailHTLC {
1383
1384
htlc_id : htlc_id_arg,
1384
1385
err_packet,
1385
1386
} ) ;
1386
1387
return Ok ( None ) ;
1387
1388
}
1388
1389
1390
+ log_trace ! ( logger, "Failure HTLC ID {} back with a update_fail_htlc message" , htlc_id_arg) ;
1389
1391
{
1390
1392
let htlc = & mut self . pending_inbound_htlcs [ pending_idx] ;
1391
1393
htlc. state = InboundHTLCState :: LocalRemoved ( InboundHTLCRemovalReason :: FailRelay ( err_packet. clone ( ) ) ) ;
@@ -2377,7 +2379,7 @@ impl<Signer: Sign> Channel<Signer> {
2377
2379
}
2378
2380
} ,
2379
2381
& HTLCUpdateAwaitingACK :: FailHTLC { htlc_id, ref err_packet } => {
2380
- match self . get_update_fail_htlc ( htlc_id, err_packet. clone ( ) ) {
2382
+ match self . get_update_fail_htlc ( htlc_id, err_packet. clone ( ) , logger ) {
2381
2383
Ok ( update_fail_msg_option) => update_fail_htlcs. push ( update_fail_msg_option. unwrap ( ) ) ,
2382
2384
Err ( e) => {
2383
2385
if let ChannelError :: Ignore ( _) = e { }
0 commit comments