File tree 1 file changed +6
-1
lines changed
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;
39
39
use crate :: sign:: { NodeSigner , Recipient } ;
40
40
41
41
use crate :: prelude:: * ;
42
+ #[ cfg( feature = "std" ) ]
42
43
use core:: convert:: TryFrom ;
43
44
use core:: fmt;
44
45
use core:: fmt:: Debug ;
45
46
use core:: ops:: Deref ;
47
+ #[ cfg( feature = "std" ) ]
46
48
use core:: str:: FromStr ;
47
49
use crate :: io:: { self , Cursor , Read } ;
48
50
use crate :: io_extras:: read_to_end;
@@ -956,7 +958,10 @@ impl From<std::net::SocketAddr> for SocketAddress {
956
958
}
957
959
}
958
960
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 > {
960
965
if host. ends_with ( ".onion" ) {
961
966
let domain = & host[ ..host. len ( ) - ".onion" . len ( ) ] ;
962
967
if domain. len ( ) != 56 {
You can’t perform that action at this time.
0 commit comments