def _check_external_ip_address(self):

        tally = dict()
        for peer in self.peers:
            address = peer.external_ip_address
            if address is None: continue
            if address not in tally: tally[address] = 0
            tally[address] += 1

        if tally:
            tally = [(tally[a], a) for a in tally]
            tally.sort()

            self._guessed_external_ip_address = tally[-1][1]
We rely on the peers we have connected to to tell us our IP address.
dataset/ETHPy150Open ricmoo/pycoind/pycoind/node/basenode.py/BaseNode._check_external_ip_address