(self)
return addresses
Return an array of (host, port, timestamp) triples.
Return an array of (host, port, timestamp) triples.
Return an array of ( host port timestamp ) triples .
def load_addresses(self):
        """
        Return an array of (host, port, timestamp) triples.
        """
        addresses = {}
        try:
            with open(self.path) as f:
                for l in f:
                    timestamp, host, port = l[:-1].split("/")
                    timestamp = int(timestamp)
                    port = int(port)
                    addresses[(host, port)] = timestamp
        except Exception:
            logging.error("can't open %s, using default", self.path)
            for h in [
                "bitseed.xf2.org", "dnsseed.bluematt.me",
                "seed.bitcoin.sipa.be", "dnsseed.bitcoin.dashjr.org"
            ]:
                addresses[(h, 8333)] = 1
        return addresses
def load_addresses ( self ) : addresses = { } try : with open ( self . path ) as f : for l in f : timestamp , host , port = l [ : - 1 ] . split ( "/" ) timestamp = int ( timestamp ) port = int ( port ) addresses [ ( host , port ) ] = timestamp except Exception : logging . error ( "can't open %s, using default" , self . path ) for h in [ "bitseed.xf2.org" , "dnsseed.bluematt.me" , "seed.bitcoin.sipa.be" , "dnsseed.bitcoin.dashjr.org" ] : addresses [ ( h , 8333 ) ] = 1 return addresses