File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
resources/maintainer_scripts Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -246,8 +246,8 @@ def _get_external_ip(self):
246246 if self ._external_ip :
247247 return self ._external_ip
248248 services = (("https://checkip.amazonaws.com" , "amazonaws.com" ),
249- ("https://ifconfig.me " , "ifconfig.me " ),
250- ("https://ident.me" , "ident.me" ))
249+ ("https://4.icanhazip.com/ " , "icanhazip.com " ),
250+ ("https://4. ident.me" , "ident.me" ))
251251 ips = []
252252 # Using our own PoolManager for shorter timeouts
253253 print ("Querying your external IP..." )
@@ -271,7 +271,7 @@ def _get_external_ip(self):
271271 def _is_valid_ip (ip ):
272272 """ Check validity of ip address """
273273 try :
274- _ = ipaddress .ip_address (ip )
274+ _ = ipaddress .IPv4Network (ip )
275275 except ValueError :
276276 return False
277277 else :
@@ -864,6 +864,10 @@ def get_trusted_hash(self):
864864 exit (1 )
865865 print (f"{ block_hash } " )
866866
867+ def get_ip (self ):
868+ """ Get external IP of node. Can be used to test code used for automatically filling IP
869+ or to check if you need to update the IP in your config.toml file. """
870+ print (self ._get_external_ip ())
867871
868872if __name__ == '__main__' :
869873 NodeUtil ()
You can’t perform that action at this time.
0 commit comments