Skip to content

Commit 3d972d7

Browse files
committed
Correct inbound HTLC upgrade logs on revoke_and_ack receipt
1 parent 664fa78 commit 3d972d7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lightning/src/ln/channel.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,22 +2568,22 @@ impl<Signer: Sign> Channel<Signer> {
25682568
});
25692569
for htlc in pending_inbound_htlcs.iter_mut() {
25702570
let swap = if let &InboundHTLCState::AwaitingRemoteRevokeToAnnounce(_) = &htlc.state {
2571-
log_trace!(logger, " ...promoting inbound AwaitingRemoteRevokeToAnnounce {} to Committed", log_bytes!(htlc.payment_hash.0));
25722571
true
25732572
} else if let &InboundHTLCState::AwaitingAnnouncedRemoteRevoke(_) = &htlc.state {
2574-
log_trace!(logger, " ...promoting inbound AwaitingAnnouncedRemoteRevoke {} to Committed", log_bytes!(htlc.payment_hash.0));
25752573
true
25762574
} else { false };
25772575
if swap {
25782576
let mut state = InboundHTLCState::Committed;
25792577
mem::swap(&mut state, &mut htlc.state);
25802578

25812579
if let InboundHTLCState::AwaitingRemoteRevokeToAnnounce(forward_info) = state {
2580+
log_trace!(logger, " ...promoting inbound AwaitingRemoteRevokeToAnnounce {} to AwaitingAnnouncedRemoteRevoke", log_bytes!(htlc.payment_hash.0));
25822581
htlc.state = InboundHTLCState::AwaitingAnnouncedRemoteRevoke(forward_info);
25832582
require_commitment = true;
25842583
} else if let InboundHTLCState::AwaitingAnnouncedRemoteRevoke(forward_info) = state {
25852584
match forward_info {
25862585
PendingHTLCStatus::Fail(fail_msg) => {
2586+
log_trace!(logger, " ...promoting inbound AwaitingAnnouncedRemoteRevoke {} to LocalRemoved due to PendingHTLCStatus indicating failure", log_bytes!(htlc.payment_hash.0));
25872587
require_commitment = true;
25882588
match fail_msg {
25892589
HTLCFailureMsg::Relay(msg) => {
@@ -2597,6 +2597,7 @@ impl<Signer: Sign> Channel<Signer> {
25972597
}
25982598
},
25992599
PendingHTLCStatus::Forward(forward_info) => {
2600+
log_trace!(logger, " ...promoting inbound AwaitingAnnouncedRemoteRevoke {} to Committed", log_bytes!(htlc.payment_hash.0));
26002601
to_forward_infos.push((forward_info, htlc.htlc_id));
26012602
htlc.state = InboundHTLCState::Committed;
26022603
}

0 commit comments

Comments
 (0)