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