Skip to content

Commit

Permalink
Simplify some code channel.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
contrun committed Dec 23, 2024
1 parent 463e432 commit 988e5aa
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5180,13 +5180,10 @@ impl<SP: Deref> Channel<SP> where
}

for htlc in self.context.pending_inbound_htlcs.iter_mut() {
let htlc_resolution = if let &InboundHTLCState::RemoteAnnounced(ref resolution) = &htlc.state {
Some(resolution.clone())
} else { None };
if let Some(htlc_resolution) = htlc_resolution {
if let &InboundHTLCState::RemoteAnnounced(ref htlc_resolution) = &htlc.state {
log_trace!(logger, "Updating HTLC {} to AwaitingRemoteRevokeToAnnounce due to commitment_signed in channel {}.",
&htlc.payment_hash, &self.context.channel_id);
htlc.state = InboundHTLCState::AwaitingRemoteRevokeToAnnounce(htlc_resolution);
htlc.state = InboundHTLCState::AwaitingRemoteRevokeToAnnounce(htlc_resolution.clone());
need_commitment = true;
}
}
Expand Down

0 comments on commit 988e5aa

Please sign in to comment.