@@ -117,19 +117,20 @@ pub(crate) const LNURL_AUTH_TIMEOUT_SECS: u64 = 15;
117117///
118118/// ### Defaults
119119///
120- /// | Parameter | Value |
121- /// |----------------------------------------|--------------------------------------|
122- /// | `storage_dir_path` | /tmp/ldk_node/ |
123- /// | `network` | Bitcoin |
124- /// | `listening_addresses` | None |
125- /// | `announcement_addresses` | None |
126- /// | `node_alias` | None |
127- /// | `trusted_peers_0conf` | [] |
128- /// | `probing_liquidity_limit_multiplier` | 3 |
129- /// | `anchor_channels_config` | Some(..) |
130- /// | `route_parameters` | None |
131- /// | `tor_config` | None |
132- /// | `hrn_config` | HumanReadableNamesConfig::default() |
120+ /// | Parameter | Value |
121+ /// |----------------------------------------|--------------------------------------------|
122+ /// | `storage_dir_path` | /tmp/ldk_node/ |
123+ /// | `network` | Bitcoin |
124+ /// | `listening_addresses` | None |
125+ /// | `announcement_addresses` | None |
126+ /// | `node_alias` | None |
127+ /// | `node_color` | NodeColor { red: 0, green: 0, blue: 0 } |
128+ /// | `trusted_peers_0conf` | [] |
129+ /// | `probing_liquidity_limit_multiplier` | 3 |
130+ /// | `anchor_channels_config` | Some(..) |
131+ /// | `route_parameters` | None |
132+ /// | `tor_config` | None |
133+ /// | `hrn_config` | HumanReadableNamesConfig::default() |
133134///
134135/// See [`AnchorChannelsConfig`] and [`RouteParametersConfig`] for more information regarding their
135136/// respective default values.
@@ -158,6 +159,8 @@ pub struct Config {
158159 /// **Note**: We will only allow opening and accepting public channels if the `node_alias` and the
159160 /// `listening_addresses` are set.
160161 pub node_alias : Option < NodeAlias > ,
162+ /// The RGB color that will be used when broadcasting announcements to the gossip network.
163+ pub node_color : NodeColor ,
161164 /// A list of peers that we allow to establish zero confirmation channels to us.
162165 ///
163166 /// **Note:** Allowing payments via zero-confirmation channels is potentially insecure if the
@@ -220,11 +223,30 @@ impl Default for Config {
220223 tor_config : None ,
221224 route_parameters : None ,
222225 node_alias : None ,
226+ node_color : NodeColor :: default ( ) ,
223227 hrn_config : HumanReadableNamesConfig :: default ( ) ,
224228 }
225229 }
226230}
227231
232+ /// The RGB color that will be used when broadcasting node announcements.
233+ #[ derive( Debug , Clone , Copy , PartialEq , Eq , Default ) ]
234+ #[ cfg_attr( feature = "uniffi" , derive( uniffi:: Record ) ) ]
235+ pub struct NodeColor {
236+ /// The red color component.
237+ pub red : u8 ,
238+ /// The green color component.
239+ pub green : u8 ,
240+ /// The blue color component.
241+ pub blue : u8 ,
242+ }
243+
244+ impl NodeColor {
245+ pub ( crate ) fn as_rgb ( & self ) -> [ u8 ; 3 ] {
246+ [ self . red , self . green , self . blue ]
247+ }
248+ }
249+
228250/// Configuration options for how our node resolves Human-Readable Names (BIP 353).
229251///
230252/// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
0 commit comments