@@ -183,7 +183,8 @@ pub enum BuildError {
183183 LoggerSetupFailed ,
184184 /// The given network does not match the node's previously configured network.
185185 NetworkMismatch ,
186- /// The role of the node in an asynchronous payments context is not compatible with the current configuration.
186+ /// The role of the node in an asynchronous payments context is not compatible with the current
187+ /// configuration.
187188 AsyncPaymentsConfigMismatch ,
188189}
189190
@@ -325,8 +326,8 @@ impl NodeBuilder {
325326
326327 /// Configures the [`Node`] instance to source its chain data from the given Esplora server.
327328 ///
328- /// The given `headers` will be included in all requests to the Esplora server, typically used for
329- /// authentication purposes.
329+ /// The given `headers` will be included in all requests to the Esplora server, typically used
330+ /// for authentication purposes.
330331 ///
331332 /// If no `sync_config` is given, default values are used. See [`EsploraSyncConfig`] for more
332333 /// information.
@@ -353,12 +354,12 @@ impl NodeBuilder {
353354
354355 /// Configures the [`Node`] instance to connect to a Bitcoin Core node via RPC.
355356 ///
356- /// This method establishes an RPC connection that enables all essential chain operations including
357- /// transaction broadcasting and chain data synchronization.
357+ /// This method establishes an RPC connection that enables all essential chain operations
358+ /// including transaction broadcasting and chain data synchronization.
358359 ///
359360 /// ## Parameters:
360- /// * `rpc_host`, `rpc_port`, `rpc_user`, `rpc_password` - Required parameters for the Bitcoin Core RPC
361- /// connection.
361+ /// * `rpc_host`, `rpc_port`, `rpc_user`, `rpc_password` - Required parameters for the Bitcoin
362+ /// Core RPC connection.
362363 pub fn set_chain_source_bitcoind_rpc (
363364 & mut self , rpc_host : String , rpc_port : u16 , rpc_user : String , rpc_password : String ,
364365 ) -> & mut Self {
@@ -372,15 +373,16 @@ impl NodeBuilder {
372373 self
373374 }
374375
375- /// Configures the [`Node`] instance to synchronize chain data from a Bitcoin Core REST endpoint.
376+ /// Configures the [`Node`] instance to synchronize chain data from a Bitcoin Core REST
377+ /// endpoint.
376378 ///
377379 /// This method enables chain data synchronization via Bitcoin Core's REST interface. We pass
378380 /// additional RPC configuration to non-REST-supported API calls like transaction broadcasting.
379381 ///
380382 /// ## Parameters:
381383 /// * `rest_host`, `rest_port` - Required parameters for the Bitcoin Core REST connection.
382- /// * `rpc_host`, `rpc_port`, `rpc_user`, `rpc_password` - Required parameters for the Bitcoin Core RPC
383- /// connection
384+ /// * `rpc_host`, `rpc_port`, `rpc_user`, `rpc_password` - Required parameters for the Bitcoin
385+ /// Core RPC connection
384386 pub fn set_chain_source_bitcoind_rest (
385387 & mut self , rest_host : String , rest_port : u16 , rpc_host : String , rpc_port : u16 ,
386388 rpc_user : String , rpc_password : String ,
@@ -413,7 +415,8 @@ impl NodeBuilder {
413415 /// Configures the [`Node`] instance to source inbound liquidity from the given
414416 /// [bLIP-51 / LSPS1] service.
415417 ///
416- /// Will mark the LSP as trusted for 0-confirmation channels, see [`Config::trusted_peers_0conf`].
418+ /// Will mark the LSP as trusted for 0-confirmation channels, see
419+ /// [`Config::trusted_peers_0conf`].
417420 ///
418421 /// The given `token` will be used by the LSP to authenticate the user.
419422 ///
@@ -434,7 +437,8 @@ impl NodeBuilder {
434437 /// Configures the [`Node`] instance to source just-in-time inbound liquidity from the given
435438 /// [bLIP-52 / LSPS2] service.
436439 ///
437- /// Will mark the LSP as trusted for 0-confirmation channels, see [`Config::trusted_peers_0conf`].
440+ /// Will mark the LSP as trusted for 0-confirmation channels, see
441+ /// [`Config::trusted_peers_0conf`].
438442 ///
439443 /// The given `token` will be used by the LSP to authenticate the user.
440444 ///
@@ -507,7 +511,8 @@ impl NodeBuilder {
507511 self
508512 }
509513
510- /// Sets the IP address and TCP port on which [`Node`] will listen for incoming network connections.
514+ /// Sets the IP address and TCP port on which [`Node`] will listen for incoming network
515+ /// connections.
511516 pub fn set_listening_addresses (
512517 & mut self , listening_addresses : Vec < SocketAddress > ,
513518 ) -> Result < & mut Self , BuildError > {
@@ -519,9 +524,11 @@ impl NodeBuilder {
519524 Ok ( self )
520525 }
521526
522- /// Sets the IP address and TCP port which [`Node`] will announce to the gossip network that it accepts connections on.
527+ /// Sets the IP address and TCP port which [`Node`] will announce to the gossip network that it
528+ /// accepts connections on.
523529 ///
524- /// **Note**: If unset, the [`listening_addresses`] will be used as the list of addresses to announce.
530+ /// **Note**: If unset, the [`listening_addresses`] will be used as the list of addresses to
531+ /// announce.
525532 ///
526533 /// [`listening_addresses`]: Self::set_listening_addresses
527534 pub fn set_announcement_addresses (
@@ -593,11 +600,12 @@ impl NodeBuilder {
593600 /// Builds a [`Node`] instance with a [VSS] backend and according to the options
594601 /// previously configured.
595602 ///
596- /// Uses [LNURL-auth] based authentication scheme as default method for authentication/authorization.
603+ /// Uses [LNURL-auth] based authentication scheme as default method for
604+ /// authentication/authorization.
597605 ///
598- /// The LNURL challenge will be retrieved by making a request to the given `lnurl_auth_server_url`.
599- /// The returned JWT token in response to the signed LNURL request, will be used for
600- /// authentication/authorization of all the requests made to VSS.
606+ /// The LNURL challenge will be retrieved by making a request to the given
607+ /// `lnurl_auth_server_url`. The returned JWT token in response to the signed LNURL request,
608+ /// will be used for authentication/authorization of all the requests made to VSS.
601609 ///
602610 /// `fixed_headers` are included as it is in all the requests made to VSS and LNURL auth server.
603611 ///
@@ -627,10 +635,9 @@ impl NodeBuilder {
627635 derive_xprv ( config, & seed_bytes, VSS_HARDENED_CHILD_INDEX , Arc :: clone ( & logger) ) ?;
628636
629637 let lnurl_auth_xprv = vss_xprv
630- . derive_priv (
631- & Secp256k1 :: new ( ) ,
632- & [ ChildNumber :: Hardened { index : VSS_LNURL_AUTH_HARDENED_CHILD_INDEX } ] ,
633- )
638+ . derive_priv ( & Secp256k1 :: new ( ) , & [ ChildNumber :: Hardened {
639+ index : VSS_LNURL_AUTH_HARDENED_CHILD_INDEX ,
640+ } ] )
634641 . map_err ( |e| {
635642 log_error ! ( logger, "Failed to derive VSS secret: {}" , e) ;
636643 BuildError :: KVStoreSetupFailed
@@ -829,8 +836,8 @@ impl ArcedNodeBuilder {
829836
830837 /// Configures the [`Node`] instance to source its chain data from the given Esplora server.
831838 ///
832- /// The given `headers` will be included in all requests to the Esplora server, typically used for
833- /// authentication purposes.
839+ /// The given `headers` will be included in all requests to the Esplora server, typically used
840+ /// for authentication purposes.
834841 ///
835842 /// If no `sync_config` is given, default values are used. See [`EsploraSyncConfig`] for more
836843 /// information.
@@ -857,12 +864,12 @@ impl ArcedNodeBuilder {
857864
858865 /// Configures the [`Node`] instance to connect to a Bitcoin Core node via RPC.
859866 ///
860- /// This method establishes an RPC connection that enables all essential chain operations including
861- /// transaction broadcasting and chain data synchronization.
867+ /// This method establishes an RPC connection that enables all essential chain operations
868+ /// including transaction broadcasting and chain data synchronization.
862869 ///
863870 /// ## Parameters:
864- /// * `rpc_host`, `rpc_port`, `rpc_user`, `rpc_password` - Required parameters for the Bitcoin Core RPC
865- /// connection.
871+ /// * `rpc_host`, `rpc_port`, `rpc_user`, `rpc_password` - Required parameters for the Bitcoin
872+ /// Core RPC connection.
866873 pub fn set_chain_source_bitcoind_rpc (
867874 & self , rpc_host : String , rpc_port : u16 , rpc_user : String , rpc_password : String ,
868875 ) {
@@ -874,15 +881,16 @@ impl ArcedNodeBuilder {
874881 ) ;
875882 }
876883
877- /// Configures the [`Node`] instance to synchronize chain data from a Bitcoin Core REST endpoint.
884+ /// Configures the [`Node`] instance to synchronize chain data from a Bitcoin Core REST
885+ /// endpoint.
878886 ///
879887 /// This method enables chain data synchronization via Bitcoin Core's REST interface. We pass
880888 /// additional RPC configuration to non-REST-supported API calls like transaction broadcasting.
881889 ///
882890 /// ## Parameters:
883891 /// * `rest_host`, `rest_port` - Required parameters for the Bitcoin Core REST connection.
884- /// * `rpc_host`, `rpc_port`, `rpc_user`, `rpc_password` - Required parameters for the Bitcoin Core RPC
885- /// connection
892+ /// * `rpc_host`, `rpc_port`, `rpc_user`, `rpc_password` - Required parameters for the Bitcoin
893+ /// Core RPC connection
886894 pub fn set_chain_source_bitcoind_rest (
887895 & self , rest_host : String , rest_port : u16 , rpc_host : String , rpc_port : u16 ,
888896 rpc_user : String , rpc_password : String ,
@@ -912,7 +920,8 @@ impl ArcedNodeBuilder {
912920 /// Configures the [`Node`] instance to source inbound liquidity from the given
913921 /// [bLIP-51 / LSPS1] service.
914922 ///
915- /// Will mark the LSP as trusted for 0-confirmation channels, see [`Config::trusted_peers_0conf`].
923+ /// Will mark the LSP as trusted for 0-confirmation channels, see
924+ /// [`Config::trusted_peers_0conf`].
916925 ///
917926 /// The given `token` will be used by the LSP to authenticate the user.
918927 ///
@@ -926,7 +935,8 @@ impl ArcedNodeBuilder {
926935 /// Configures the [`Node`] instance to source just-in-time inbound liquidity from the given
927936 /// [bLIP-52 / LSPS2] service.
928937 ///
929- /// Will mark the LSP as trusted for 0-confirmation channels, see [`Config::trusted_peers_0conf`].
938+ /// Will mark the LSP as trusted for 0-confirmation channels, see
939+ /// [`Config::trusted_peers_0conf`].
930940 ///
931941 /// The given `token` will be used by the LSP to authenticate the user.
932942 ///
@@ -982,16 +992,19 @@ impl ArcedNodeBuilder {
982992 self . inner . write ( ) . unwrap ( ) . set_network ( network) ;
983993 }
984994
985- /// Sets the IP address and TCP port on which [`Node`] will listen for incoming network connections.
995+ /// Sets the IP address and TCP port on which [`Node`] will listen for incoming network
996+ /// connections.
986997 pub fn set_listening_addresses (
987998 & self , listening_addresses : Vec < SocketAddress > ,
988999 ) -> Result < ( ) , BuildError > {
9891000 self . inner . write ( ) . unwrap ( ) . set_listening_addresses ( listening_addresses) . map ( |_| ( ) )
9901001 }
9911002
992- /// Sets the IP address and TCP port which [`Node`] will announce to the gossip network that it accepts connections on.
1003+ /// Sets the IP address and TCP port which [`Node`] will announce to the gossip network that it
1004+ /// accepts connections on.
9931005 ///
994- /// **Note**: If unset, the [`listening_addresses`] will be used as the list of addresses to announce.
1006+ /// **Note**: If unset, the [`listening_addresses`] will be used as the list of addresses to
1007+ /// announce.
9951008 ///
9961009 /// [`listening_addresses`]: Self::set_listening_addresses
9971010 pub fn set_announcement_addresses (
@@ -1030,11 +1043,12 @@ impl ArcedNodeBuilder {
10301043 /// Builds a [`Node`] instance with a [VSS] backend and according to the options
10311044 /// previously configured.
10321045 ///
1033- /// Uses [LNURL-auth] based authentication scheme as default method for authentication/authorization.
1046+ /// Uses [LNURL-auth] based authentication scheme as default method for
1047+ /// authentication/authorization.
10341048 ///
1035- /// The LNURL challenge will be retrieved by making a request to the given `lnurl_auth_server_url`.
1036- /// The returned JWT token in response to the signed LNURL request, will be used for
1037- /// authentication/authorization of all the requests made to VSS.
1049+ /// The LNURL challenge will be retrieved by making a request to the given
1050+ /// `lnurl_auth_server_url`. The returned JWT token in response to the signed LNURL request,
1051+ /// will be used for authentication/authorization of all the requests made to VSS.
10381052 ///
10391053 /// `fixed_headers` are included as it is in all the requests made to VSS and LNURL auth server.
10401054 ///
@@ -1116,7 +1130,12 @@ fn build_with_store_internal(
11161130
11171131 if let Err ( err) = may_announce_channel ( & config) {
11181132 if config. announcement_addresses . is_some ( ) {
1119- log_error ! ( logger, "Announcement addresses were set but some required configuration options for node announcement are missing: {}" , err) ;
1133+ log_error ! (
1134+ logger,
1135+ "Announcement addresses were set but some required configuration options for node \
1136+ announcement are missing: {}",
1137+ err
1138+ ) ;
11201139 let build_error = if matches ! ( err, AnnounceError :: MissingNodeAlias ) {
11211140 BuildError :: InvalidNodeAlias
11221141 } else {
@@ -1126,7 +1145,12 @@ fn build_with_store_internal(
11261145 }
11271146
11281147 if config. node_alias . is_some ( ) {
1129- log_error ! ( logger, "Node alias was set but some required configuration options for node announcement are missing: {}" , err) ;
1148+ log_error ! (
1149+ logger,
1150+ "Node alias was set but some required configuration options for node announcement \
1151+ are missing: {}",
1152+ err
1153+ ) ;
11301154 return Err ( BuildError :: InvalidListeningAddresses ) ;
11311155 }
11321156 }
@@ -1747,7 +1771,8 @@ fn optionally_install_rustls_cryptoprovider() {
17471771 static INIT_CRYPTO : Once = Once :: new ( ) ;
17481772
17491773 INIT_CRYPTO . call_once ( || {
1750- // Ensure we always install a `CryptoProvider` for `rustls` if it was somehow not previously installed by now.
1774+ // Ensure we always install a `CryptoProvider` for `rustls` if it was somehow not previously
1775+ // installed by now.
17511776 if rustls:: crypto:: CryptoProvider :: get_default ( ) . is_none ( ) {
17521777 let _ = rustls:: crypto:: ring:: default_provider ( ) . install_default ( ) ;
17531778 }
@@ -1830,7 +1855,8 @@ fn derive_xprv(
18301855 } )
18311856}
18321857
1833- /// Sanitize the user-provided node alias to ensure that it is a valid protocol-specified UTF-8 string.
1858+ /// Sanitize the user-provided node alias to ensure that it is a valid protocol-specified UTF-8
1859+ /// string.
18341860pub ( crate ) fn sanitize_alias ( alias_str : & str ) -> Result < NodeAlias , BuildError > {
18351861 let alias = alias_str. trim ( ) ;
18361862
0 commit comments