def heartbeat(self):

        peers = self.peers

        # if we need more peer connections, attempt to add some (up to 5 at a time)
        for i in xrange(0, min(self._seek_peers - len(peers), 5)):
            self.add_any_peer()

        # if we don't have many addresses ask any peer for some more
        if peers and len(self._addresses) < 50:
            peer = random.choice(peers)
            peer.send_message(protocol.GetAddress())

        # Give a little back to peers that were bad but seem to be good now
        for peer in peers:
            peer.reduce_banscore()

        # Give all the peers a little more room for relaying
        self._decay_relay()

    # asyncore operations
Called about every 10 seconds to perform maintenance tasks.
dataset/ETHPy150Open ricmoo/pycoind/pycoind/node/basenode.py/BaseNode.heartbeat