Esempio n. 1
0
def get_peers_derp(ip, key, path, version):
    print('check', ip, version)
    ident, peers = db.get_peers(key, version)
    if not peers:
        peers = get_all_peers(con(), path)
        print(('adding peers to db', len(peers)))
        ident, peers = db.set_peers(key, peers, version)
    else:
        print(('got db peers!', len(peers)))
    return peers, ident, ip
Esempio n. 2
0
def get_peers_derp(ip,key,path,version):
    print('check',ip,version)
    ident,peers = db.get_peers(key,version)
    if not peers:
        peers = get_all_peers(con(), path)
        print(('adding peers to db',len(peers)))
        ident,peers = db.set_peers(key,peers,version)
    else:
        print(('got db peers!',len(peers)))
    return peers,ident,ip
Esempio n. 3
0
def list_peers(environ):
    return dumps(db.get_peers(), indent=4)