@@ -56,6 +56,7 @@ use crate::sync::Mutex;
56
56
use crate::sign::type_resolver::ChannelSignerType;
57
57
58
58
use super::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint, RevocationBasepoint};
59
+ use super::channelmanager::TICKS_PER_MINUTE;
59
60
60
61
#[cfg(test)]
61
62
pub struct ChannelValueStat {
@@ -968,9 +969,9 @@ pub(super) enum ChannelUpdateStatus {
968
969
/// We've announced the channel as enabled and are connected to our peer.
969
970
Enabled,
970
971
/// Our channel is no longer live, but we haven't announced the channel as disabled yet.
971
- DisabledStaged(u8 ),
972
+ DisabledStaged(u16 ),
972
973
/// Our channel is live again, but we haven't announced the channel as enabled yet.
973
- EnabledStaged(u8 ),
974
+ EnabledStaged(u16 ),
974
975
/// We've announced the channel as disabled.
975
976
Disabled,
976
977
}
@@ -1160,23 +1161,23 @@ pub(crate) const MIN_AFFORDABLE_HTLC_COUNT: usize = 4;
1160
1161
/// number of ticks to allow forwarding HTLCs by nodes that have yet to receive the new
1161
1162
/// ChannelUpdate prompted by the config update. This value was determined as follows:
1162
1163
///
1163
- /// * The expected interval between ticks (1 minute ).
1164
+ /// * The expected interval between ticks (1 second ).
1164
1165
/// * The average convergence delay of updates across the network, i.e., ~300 seconds on average
1165
1166
/// for a node to see an update as seen on `<https://arxiv.org/pdf/2205.12737.pdf>`.
1166
1167
/// * `EXPIRE_PREV_CONFIG_TICKS` = convergence_delay / tick_interval
1167
- pub(crate) const EXPIRE_PREV_CONFIG_TICKS: usize = 5;
1168
+ pub(crate) const EXPIRE_PREV_CONFIG_TICKS: usize = 5 * TICKS_PER_MINUTE as usize ;
1168
1169
1169
1170
/// The number of ticks that may elapse while we're waiting for a response to a
1170
1171
/// [`msgs::RevokeAndACK`] or [`msgs::ChannelReestablish`] message before we attempt to disconnect
1171
1172
/// them.
1172
1173
///
1173
1174
/// See [`ChannelContext::sent_message_awaiting_response`] for more information.
1174
- pub(crate) const DISCONNECT_PEER_AWAITING_RESPONSE_TICKS: usize = 2;
1175
+ pub(crate) const DISCONNECT_PEER_AWAITING_RESPONSE_TICKS: usize = 2 * TICKS_PER_MINUTE as usize ;
1175
1176
1176
1177
/// The number of ticks that may elapse while we're waiting for an unfunded outbound/inbound channel
1177
1178
/// to be promoted to a [`Channel`] since the unfunded channel was created. An unfunded channel
1178
1179
/// exceeding this age limit will be force-closed and purged from memory.
1179
- pub(crate) const UNFUNDED_CHANNEL_AGE_LIMIT_TICKS: usize = 60;
1180
+ pub(crate) const UNFUNDED_CHANNEL_AGE_LIMIT_TICKS: usize = 60 * TICKS_PER_MINUTE as usize ;
1180
1181
1181
1182
/// Number of blocks needed for an output from a coinbase transaction to be spendable.
1182
1183
pub(crate) const COINBASE_MATURITY: u32 = 100;
@@ -3608,7 +3609,7 @@ pub(super) struct Channel<SP: Deref> where SP::Target: SignerProvider {
3608
3609
/// The number of ticks before the channel is forced closed if
3609
3610
/// no progress on closing_signed negotiation is being made.
3610
3611
/// An unprogressed channel that exceeds this limit will be abandoned.
3611
- const UNPROGRESS_CLOSING_SIGNED_NEGOTIATION_AGE_LIMIT_TICKS: i32 = 1;
3612
+ pub(crate) const UNPROGRESS_CLOSING_SIGNED_NEGOTIATION_AGE_LIMIT_TICKS: i32 = 1 * TICKS_PER_MINUTE as i32 ;
3612
3613
3613
3614
#[cfg(any(test, fuzzing))]
3614
3615
struct CommitmentTxInfoCached {
@@ -5716,7 +5717,7 @@ impl<SP: Deref> Channel<SP> where
5716
5717
5717
5718
/// Checks if the closing_signed negotiation is making appropriate progress, possibly returning
5718
5719
/// an Err if no progress is being made and the channel should be force-closed instead.
5719
- /// Should be called on a one-minute timer.
5720
+ /// Should be called on a one-second timer.
5720
5721
pub fn timer_check_closing_negotiation_progress(&mut self) -> Result<(), ChannelError> {
5721
5722
if self.closing_negotiation_ready() {
5722
5723
if self.context.closing_signed_in_flight {
0 commit comments