Skip to content

Commit 8e842bf

Browse files
author
Antoine Riard
committed
Increase visibility of protocol-level consts
1 parent 505102d commit 8e842bf

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

lightning/src/ln/chan_utils.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,19 @@ use core::ops::Deref;
4141
use crate::chain;
4242
use crate::util::crypto::sign;
4343

44-
pub(crate) const MAX_HTLCS: u16 = 483;
45-
pub(crate) const OFFERED_HTLC_SCRIPT_WEIGHT: usize = 133;
46-
pub(crate) const OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS: usize = 136;
47-
// The weight of `accepted_htlc_script` can vary in function of its CLTV argument value. We define a
48-
// range that encompasses both its non-anchors and anchors variants.
49-
pub(crate) const MIN_ACCEPTED_HTLC_SCRIPT_WEIGHT: usize = 136;
50-
pub(crate) const MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT: usize = 143;
44+
/// Maximum number of one-way in-flight HTLC (protocol-level value).
45+
pub const MAX_HTLCS: u16 = 483;
46+
/// The weight of HTLC second-stage `offered_htlc_script` non-anchor variant.
47+
pub const OFFERED_HTLC_SCRIPT_WEIGHT: usize = 133;
48+
/// The weight of HTLC second-stage `offered_htlc_script` anchor variant.
49+
pub const OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS: usize = 136;
50+
51+
/// The weight of `accepted_htlc_script` can vary in function of its CLTV argument value.
52+
/// We define a range that encompasses both its non-anchors and anchors variants.
53+
/// Lower bound of the range.
54+
pub const MIN_ACCEPTED_HTLC_SCRIPT_WEIGHT: usize = 136;
55+
/// Upper bound of the range.
56+
pub const MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT: usize = 143;
5157

5258
/// Gets the weight for an HTLC-Success transaction.
5359
#[inline]

lightning/src/ln/msgs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use crate::util::ser::{BigSize, LengthReadable, Readable, ReadableArgs, Writeabl
4747
use crate::ln::{PaymentPreimage, PaymentHash, PaymentSecret};
4848

4949
/// 21 million * 10^8 * 1000
50-
pub(crate) const MAX_VALUE_MSAT: u64 = 21_000_000_0000_0000_000;
50+
pub const MAX_VALUE_MSAT: u64 = 21_000_000_0000_0000_000;
5151

5252
/// An error in decoding a message or struct.
5353
#[derive(Clone, Debug, PartialEq, Eq)]

0 commit comments

Comments
 (0)