Skip to content

Commit 763fc5f

Browse files
committed
Add further comments around fee update handling in channel
These were suggested to clarify behavior in post-merge review of #985.
1 parent f7d1cb8 commit 763fc5f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightning/src/ln/channel.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -3705,6 +3705,8 @@ impl<Signer: Sign> Channel<Signer> {
37053705
// more dust balance if the feerate increases when we have several HTLCs pending
37063706
// which are near the dust limit.
37073707
let mut feerate_per_kw = self.feerate_per_kw;
3708+
// If there's a pending update fee, use it to ensure we aren't under-estimating
3709+
// potential feerate updates coming soon.
37083710
if let Some((feerate, _)) = self.pending_update_fee {
37093711
feerate_per_kw = cmp::max(feerate_per_kw, feerate);
37103712
}
@@ -4941,9 +4943,10 @@ impl<Signer: Sign> Writeable for Channel<Signer> {
49414943
if self.is_outbound() {
49424944
self.pending_update_fee.map(|(a, _)| a).write(writer)?;
49434945
} else if let Some((feerate, FeeUpdateState::AwaitingRemoteRevokeToAnnounce)) = self.pending_update_fee {
4944-
// As for inbound HTLCs, if the update was only announced and never committed, drop it.
49454946
Some(feerate).write(writer)?;
49464947
} else {
4948+
// As for inbound HTLCs, if the update was only announced and never committed in a
4949+
// commitment_signed, drop it.
49474950
None::<u32>.write(writer)?;
49484951
}
49494952
self.holding_cell_update_fee.write(writer)?;

0 commit comments

Comments
 (0)