Skip to content

Commit 9a665ca

Browse files
committed
public scid utils
1 parent d2242f6 commit 9a665ca

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)]
@@ -34,7 +35,6 @@ pub(crate) mod chacha20;
3435
pub(crate) mod poly1305;
3536
pub(crate) mod chacha20poly1305rfc;
3637
pub(crate) mod transaction_utils;
37-
pub(crate) mod scid_utils;
3838
pub(crate) mod time;
3939

4040
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)