Skip to content

Commit 51d9ee3

Browse files
authored
Merge pull request #2694 from Evanfeenstra/public-scid-utils
public scid utils
2 parents 76fff95 + 9a665ca commit 51d9ee3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lightning/src/util/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub mod ser;
2020
pub mod message_signing;
2121
pub mod invoice;
2222
pub mod persist;
23+
pub mod scid_utils;
2324
pub mod string;
2425
pub mod wakers;
2526
#[cfg(fuzzing)]
@@ -30,7 +31,6 @@ pub(crate) mod base32;
3031
pub(crate) mod atomic_counter;
3132
pub(crate) mod byte_utils;
3233
pub(crate) mod transaction_utils;
33-
pub(crate) mod scid_utils;
3434
pub(crate) mod time;
3535

3636
pub mod indexed_map;

lightning/src/util/scid_utils.rs

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10+
//! Utilities for creating and parsing short channel ids.
11+
1012
/// Maximum block height that can be used in a `short_channel_id`. This
1113
/// value is based on the 3-bytes available for block height.
1214
pub const MAX_SCID_BLOCK: u64 = 0x00ffffff;
@@ -22,8 +24,11 @@ pub const MAX_SCID_VOUT_INDEX: u64 = 0xffff;
2224
/// A `short_channel_id` construction error
2325
#[derive(Debug, PartialEq, Eq)]
2426
pub enum ShortChannelIdError {
27+
/// Block height too high
2528
BlockOverflow,
29+
/// Tx index too high
2630
TxIndexOverflow,
31+
/// Vout index too high
2732
VoutIndexOverflow,
2833
}
2934

@@ -91,8 +96,11 @@ pub(crate) mod fake_scid {
9196
/// into the fake scid.
9297
#[derive(Copy, Clone)]
9398
pub(crate) enum Namespace {
99+
/// Phantom nodes namespace
94100
Phantom,
101+
/// SCID aliases for outbound private channels
95102
OutboundAlias,
103+
/// Payment interception namespace
96104
Intercept
97105
}
98106

0 commit comments

Comments
 (0)