Skip to content

Commit

Permalink
-f Add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Riard committed Oct 21, 2021
1 parent 9a6d79c commit 2e3fd85
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2825,6 +2825,9 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
log_bytes!(chan_id[..]), chan.get_feerate(), new_feerate);
return (true, NotifyOption::SkipPersist, Ok(()));
}
// If the channel is inbound and we detect a relevant feerate increase, we assume
// that our counterparty, reasonably implemented, should send us an `update_fee`
// soon. Monitoring this situation, we start an autoclose timer.
if !chan.is_outbound() {
if chan.maybe_trigger_autoclose_timer() {
return (true, NotifyOption::DoPersist, Ok(()));
Expand Down Expand Up @@ -2876,6 +2879,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
(retain_channel, NotifyOption::DoPersist, ret_err)
}

/// Close the channel if the feerate is non-satisfying to ensure efficient confirmation
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>) {
let mut retain_channel = true;
let mut notify_option = NotifyOption::SkipPersist;
Expand Down

0 comments on commit 2e3fd85

Please sign in to comment.