Dont reconnect on every block

This commit is contained in:
HelloZeroNet 2016-04-07 12:29:47 +02:00
parent 915dd92b5a
commit faa2c3e6ce

View file

@ -173,7 +173,6 @@ while 1:
sys.stdout.flush() sys.stdout.flush()
while 1: while 1:
try: try:
rpc = AuthServiceProxy(rpc_auth, timeout=rpc_timeout)
time.sleep(1) time.sleep(1)
rpc.waitforblock() rpc.waitforblock()
print "Found" print "Found"
@ -184,6 +183,7 @@ while 1:
except Exception, err: except Exception, err:
print "Exception", err.__class__, err print "Exception", err.__class__, err
time.sleep(5) time.sleep(5)
rpc = AuthServiceProxy(rpc_auth, timeout=rpc_timeout)
last_block = int(rpc.getinfo()["blocks"]) last_block = int(rpc.getinfo()["blocks"])
should_publish = False should_publish = False