2626//! [`send_payment`], etc.:
2727//!
2828//! ```no_run
29- //! use ldk_node::{Builder, NetAddress };
29+ //! use ldk_node::{Builder, SocketAddress };
3030//! use ldk_node::lightning_invoice::Bolt11Invoice;
3131//! use ldk_node::bitcoin::secp256k1::PublicKey;
3232//! use ldk_node::bitcoin::Network;
4747//! // .. fund address ..
4848//!
4949//! let node_id = PublicKey::from_str("NODE_ID").unwrap();
50- //! let node_addr = NetAddress ::from_str("IP_ADDR:PORT").unwrap();
50+ //! let node_addr = SocketAddress ::from_str("IP_ADDR:PORT").unwrap();
5151//! node.connect_open_channel(node_id, node_addr, 10000, None, None, false).unwrap();
5252//!
5353//! let event = node.wait_next_event();
@@ -100,7 +100,7 @@ use error::Error;
100100
101101pub use event:: Event ;
102102pub use types:: ChannelConfig ;
103- pub use types:: NetAddress ;
103+ pub use types:: SocketAddress ;
104104
105105pub use io:: utils:: generate_entropy_mnemonic;
106106
@@ -225,7 +225,7 @@ pub struct Config {
225225 /// The used Bitcoin network.
226226 pub network : Network ,
227227 /// The IP address and TCP port the node will listen on.
228- pub listening_address : Option < NetAddress > ,
228+ pub listening_address : Option < SocketAddress > ,
229229 /// The default CLTV expiry delta to be used for payments.
230230 pub default_cltv_expiry_delta : u32 ,
231231 /// The time in-between background sync attempts of the onchain wallet, in seconds.
@@ -504,7 +504,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
504504 "Unable to resolve listing address: {:?}" ,
505505 listening_address
506506 ) ;
507- Error :: InvalidNetAddress
507+ Error :: InvalidSocketAddress
508508 } ) ?
509509 . next ( )
510510 . ok_or_else ( || {
@@ -513,7 +513,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
513513 "Unable to resolve listing address: {:?}" ,
514514 listening_address
515515 ) ;
516- Error :: InvalidNetAddress
516+ Error :: InvalidSocketAddress
517517 } ) ?;
518518
519519 runtime. spawn ( async move {
@@ -776,7 +776,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
776776 }
777777
778778 /// Returns our own listening address.
779- pub fn listening_address ( & self ) -> Option < NetAddress > {
779+ pub fn listening_address ( & self ) -> Option < SocketAddress > {
780780 self . config . listening_address . clone ( )
781781 }
782782
@@ -833,7 +833,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
833833 ///
834834 /// If `persist` is set to `true`, we'll remember the peer and reconnect to it on restart.
835835 pub fn connect (
836- & self , node_id : PublicKey , address : NetAddress , persist : bool ,
836+ & self , node_id : PublicKey , address : SocketAddress , persist : bool ,
837837 ) -> Result < ( ) , Error > {
838838 let rt_lock = self . runtime . read ( ) . unwrap ( ) ;
839839 if rt_lock. is_none ( ) {
@@ -898,7 +898,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
898898 ///
899899 /// Returns a temporary channel id.
900900 pub fn connect_open_channel (
901- & self , node_id : PublicKey , address : NetAddress , channel_amount_sats : u64 ,
901+ & self , node_id : PublicKey , address : SocketAddress , channel_amount_sats : u64 ,
902902 push_to_counterparty_msat : Option < u64 > , channel_config : Option < Arc < ChannelConfig > > ,
903903 announce_channel : bool ,
904904 ) -> Result < ( ) , Error > {
@@ -1536,7 +1536,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
15361536 let stored_peer = self . peer_store . get_peer ( & node_id) ;
15371537 let stored_addr_opt = stored_peer. as_ref ( ) . map ( |p| p. address . clone ( ) ) ;
15381538 let address = match ( con_addr_opt, stored_addr_opt) {
1539- ( Some ( con_addr) , _) => NetAddress ( con_addr) ,
1539+ ( Some ( con_addr) , _) => SocketAddress ( con_addr) ,
15401540 ( None , Some ( stored_addr) ) => stored_addr,
15411541 ( None , None ) => continue ,
15421542 } ;
@@ -1590,7 +1590,7 @@ impl<K: KVStore + Sync + Send + 'static> Drop for Node<K> {
15901590}
15911591
15921592async fn connect_peer_if_necessary < K : KVStore + Sync + Send + ' static > (
1593- node_id : PublicKey , addr : NetAddress , peer_manager : Arc < PeerManager < K > > ,
1593+ node_id : PublicKey , addr : SocketAddress , peer_manager : Arc < PeerManager < K > > ,
15941594 logger : Arc < FilesystemLogger > ,
15951595) -> Result < ( ) , Error > {
15961596 for ( pman_node_id, _pman_addr) in peer_manager. get_peer_node_ids ( ) {
@@ -1603,7 +1603,7 @@ async fn connect_peer_if_necessary<K: KVStore + Sync + Send + 'static>(
16031603}
16041604
16051605async fn do_connect_peer < K : KVStore + Sync + Send + ' static > (
1606- node_id : PublicKey , addr : NetAddress , peer_manager : Arc < PeerManager < K > > ,
1606+ node_id : PublicKey , addr : SocketAddress , peer_manager : Arc < PeerManager < K > > ,
16071607 logger : Arc < FilesystemLogger > ,
16081608) -> Result < ( ) , Error > {
16091609 log_info ! ( logger, "Connecting to peer: {}@{}" , node_id, addr) ;
@@ -1612,7 +1612,7 @@ async fn do_connect_peer<K: KVStore + Sync + Send + 'static>(
16121612 . to_socket_addrs ( )
16131613 . map_err ( |e| {
16141614 log_error ! ( logger, "Failed to resolve network address: {}" , e) ;
1615- Error :: InvalidNetAddress
1615+ Error :: InvalidSocketAddress
16161616 } ) ?
16171617 . next ( )
16181618 . ok_or ( Error :: ConnectionFailed ) ?;
0 commit comments