minor
This commit is contained in:
parent
e1c72d1356
commit
cdd6bbea6f
|
@ -289,7 +289,7 @@ def listen_thread(store):
|
||||||
|
|
||||||
|
|
||||||
def client_thread(ipaddr,conn):
|
def client_thread(ipaddr,conn):
|
||||||
print "client thread", ipaddr
|
#print "client thread", ipaddr
|
||||||
try:
|
try:
|
||||||
ipaddr = ipaddr[0]
|
ipaddr = ipaddr[0]
|
||||||
msg = ''
|
msg = ''
|
||||||
|
@ -299,7 +299,7 @@ def client_thread(ipaddr,conn):
|
||||||
if d[-1]=='#':
|
if d[-1]=='#':
|
||||||
break
|
break
|
||||||
|
|
||||||
print msg
|
#print msg
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cmd, data = ast.literal_eval(msg[:-1])
|
cmd, data = ast.literal_eval(msg[:-1])
|
||||||
|
@ -314,7 +314,7 @@ def client_thread(ipaddr,conn):
|
||||||
elif cmd=='session':
|
elif cmd=='session':
|
||||||
import random, string
|
import random, string
|
||||||
session_id = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(10))
|
session_id = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(10))
|
||||||
print "new session", ipaddr, session_id
|
print "new session", ipaddr, session_id, data
|
||||||
|
|
||||||
addresses = ast.literal_eval(data)
|
addresses = ast.literal_eval(data)
|
||||||
sessions[session_id] = {}
|
sessions[session_id] = {}
|
||||||
|
@ -383,7 +383,7 @@ def memorypool_update(store):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
store.import_tx(tx, False)
|
store.import_tx(tx, False)
|
||||||
print tx['hash'][::-1].encode('hex')
|
#print tx['hash'][::-1].encode('hex')
|
||||||
store.commit()
|
store.commit()
|
||||||
|
|
||||||
import traceback
|
import traceback
|
||||||
|
@ -398,6 +398,8 @@ if __name__ == '__main__':
|
||||||
store = MyStore(args)
|
store = MyStore(args)
|
||||||
|
|
||||||
thread.start_new_thread(listen_thread, (store,))
|
thread.start_new_thread(listen_thread, (store,))
|
||||||
|
#listen_thread(store)
|
||||||
|
#exit(0)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue