File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -39,10 +39,12 @@ use crate::onion_message;
3939use crate :: sign:: { NodeSigner , Recipient } ;
4040
4141use crate :: prelude:: * ;
42+ #[ cfg( feature = "std" ) ]
4243use core:: convert:: TryFrom ;
4344use core:: fmt;
4445use core:: fmt:: Debug ;
4546use core:: ops:: Deref ;
47+ #[ cfg( feature = "std" ) ]
4648use core:: str:: FromStr ;
4749use crate :: io:: { self , Cursor , Read } ;
4850use crate :: io_extras:: read_to_end;
@@ -956,7 +958,10 @@ impl From<std::net::SocketAddr> for SocketAddress {
956958 }
957959}
958960
959- fn parse_onion_address ( host : & str , port : u16 ) -> Result < SocketAddress , SocketAddressParseError > {
961+ /// Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
962+ ///
963+ /// The host part must end with ".onion".
964+ pub fn parse_onion_address ( host : & str , port : u16 ) -> Result < SocketAddress , SocketAddressParseError > {
960965 if host. ends_with ( ".onion" ) {
961966 let domain = & host[ ..host. len ( ) - ".onion" . len ( ) ] ;
962967 if domain. len ( ) != 56 {
You can’t perform that action at this time.
0 commit comments