Skip to content

Commit 2e3fd85

Browse files
author
Antoine Riard
committed
-f Add more comments
1 parent 9a6d79c commit 2e3fd85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lightning/src/ln/channelmanager.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2825,6 +2825,9 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
28252825
log_bytes!(chan_id[..]), chan.get_feerate(), new_feerate);
28262826
return (true, NotifyOption::SkipPersist, Ok(()));
28272827
}
2828+
// If the channel is inbound and we detect a relevant feerate increase, we assume
2829+
// that our counterparty, reasonably implemented, should send us an `update_fee`
2830+
// soon. Monitoring this situation, we start an autoclose timer.
28282831
if !chan.is_outbound() {
28292832
if chan.maybe_trigger_autoclose_timer() {
28302833
return (true, NotifyOption::DoPersist, Ok(()));
@@ -2876,6 +2879,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
28762879
(retain_channel, NotifyOption::DoPersist, ret_err)
28772880
}
28782881

2882+
/// Close the channel if the feerate is non-satisfying to ensure efficient confirmation
28792883
fn check_channel_autoclose(&self, short_to_id: &mut HashMap<u64, [u8; 32]>, chan_id: &[u8; 32], chan: &mut Channel<Signer>) -> (bool, NotifyOption, Result<(), MsgHandleErrInternal>) {
28802884
let mut retain_channel = true;
28812885
let mut notify_option = NotifyOption::SkipPersist;

0 commit comments

Comments
 (0)