public scid utils
authorEvan Feenstra <evanfeenstra@gmail.com>
Sat, 28 Oct 2023 15:38:17 +0000 (08:38 -0700)
committerEvan Feenstra <evanfeenstra@gmail.com>
Sun, 21 Jan 2024 19:20:52 +0000 (11:20 -0800)
lightning/src/util/mod.rs
lightning/src/util/scid_utils.rs

index e86885a83dbd0160b42bc103ecb5e737ea39bb7b..9affed555c51c06f7d921461d02e9eb6e1369940 100644 (file)
@@ -20,6 +20,7 @@ pub mod ser;
 pub mod message_signing;
 pub mod invoice;
 pub mod persist;
+pub mod scid_utils;
 pub mod string;
 pub mod wakers;
 #[cfg(fuzzing)]
@@ -34,7 +35,6 @@ pub(crate) mod chacha20;
 pub(crate) mod poly1305;
 pub(crate) mod chacha20poly1305rfc;
 pub(crate) mod transaction_utils;
-pub(crate) mod scid_utils;
 pub(crate) mod time;
 
 pub mod indexed_map;
index fbbcc69a133e0966e8bd937d1838ac8dc4fd5c17..d74f18e93bed32943496f20d7d5feb548028ab84 100644 (file)
@@ -7,6 +7,8 @@
 // You may not use this file except in accordance with one or both of these
 // licenses.
 
+//! Utilities for creating and parsing short channel ids.
+
 /// Maximum block height that can be used in a `short_channel_id`. This
 /// value is based on the 3-bytes available for block height.
 pub const MAX_SCID_BLOCK: u64 = 0x00ffffff;
@@ -22,8 +24,11 @@ pub const MAX_SCID_VOUT_INDEX: u64 = 0xffff;
 /// A `short_channel_id` construction error
 #[derive(Debug, PartialEq, Eq)]
 pub enum ShortChannelIdError {
+       /// Block height too high
        BlockOverflow,
+       /// Tx index too high
        TxIndexOverflow,
+       /// Vout index too high
        VoutIndexOverflow,
 }
 
@@ -91,8 +96,11 @@ pub(crate) mod fake_scid {
        /// into the fake scid.
        #[derive(Copy, Clone)]
        pub(crate) enum Namespace {
+               /// Phantom nodes namespace
                Phantom,
+               /// SCID aliases for outbound private channels
                OutboundAlias,
+               /// Payment interception namespace
                Intercept
        }