|
@ -487,6 +487,8 @@ def client_thread(ipaddr,conn): |
|
|
|
|
|
|
|
|
def do_command(cmd, data, ipaddr): |
|
|
def do_command(cmd, data, ipaddr): |
|
|
|
|
|
|
|
|
|
|
|
timestr = time.strftime("[%d/%m/%Y-%H:%M:%S]") |
|
|
|
|
|
|
|
|
if cmd=='b': |
|
|
if cmd=='b': |
|
|
out = "%d"%block_number |
|
|
out = "%d"%block_number |
|
|
|
|
|
|
|
@ -501,7 +503,7 @@ def do_command(cmd, data, ipaddr): |
|
|
except: |
|
|
except: |
|
|
print "error", data |
|
|
print "error", data |
|
|
return None |
|
|
return None |
|
|
print time.strftime("[%d/%m/%Y-%H:%M:%S]"), "new session", ipaddr, addresses[0] if addresses else addresses, len(addresses), version |
|
|
print timestr, "new session", ipaddr, addresses[0] if addresses else addresses, len(addresses), version |
|
|
out = new_session(version, addresses) |
|
|
out = new_session(version, addresses) |
|
|
|
|
|
|
|
|
elif cmd=='update_session': |
|
|
elif cmd=='update_session': |
|
@ -510,7 +512,7 @@ def do_command(cmd, data, ipaddr): |
|
|
except: |
|
|
except: |
|
|
print "error" |
|
|
print "error" |
|
|
return None |
|
|
return None |
|
|
print time.strftime("[%d/%m/%Y-%H:%M:%S]"), "update session", ipaddr, addresses[0] if addresses else addresses, len(addresses) |
|
|
print timestr, "update session", ipaddr, addresses[0] if addresses else addresses, len(addresses) |
|
|
out = update_session(session_id,addresses) |
|
|
out = update_session(session_id,addresses) |
|
|
|
|
|
|
|
|
elif cmd == 'bccapi_login': |
|
|
elif cmd == 'bccapi_login': |
|
@ -573,7 +575,7 @@ def do_command(cmd, data, ipaddr): |
|
|
|
|
|
|
|
|
elif cmd =='tx': |
|
|
elif cmd =='tx': |
|
|
out = send_tx(data) |
|
|
out = send_tx(data) |
|
|
print "sent tx:", out |
|
|
print timestr, "sent tx:", ipaddr, out |
|
|
|
|
|
|
|
|
elif cmd == 'stop': |
|
|
elif cmd == 'stop': |
|
|
out = cmd_stop(data) |
|
|
out = cmd_stop(data) |
|
|