sessions = {}
+sessions_last_time = {}
dblock = thread.allocate_lock()
print time.asctime(), "session", ipaddr, session_id, addresses[0], len(addresses)
+ clean_sessions()
sessions[session_id] = {}
for a in addresses:
sessions[session_id][a] = ''
out = repr( (session_id, SERVER_MESSAGE) )
+ sessions_last_time[session_id] = time.time()
elif cmd=='poll':
session_id = data
print "session not found", ipaddr
out = repr( (-1, {}))
else:
+ sessions_last_time[session_id] = time.time()
ret = {}
for addr in addresses:
status = store.get_status( addr )
#print tx['hash'][::-1].encode('hex')
store.commit()
+
+
+
+def clean_sessions():
+ t = time.time()
+ for k,t0 in sessions_last_time.items():
+ if t - t0 > 60:
+ print "lost session",k
+ sessions.pop(k)
+ sessions_last_time.pop(k)
+
+
+
import traceback
store = MyStore(args)
thread.start_new_thread(listen_thread, (store,))
- #listen_thread(store)
- #exit(0)
while True:
try:
+++ /dev/null
-#!/usr/bin/python
-from distutils.core import setup
-
-setup(name = "Electrum",
- version = "0.21",
- description = "Lightweight Bitcoin Wallet",
- author = "thomasv",
- license = "GNU GPLv3",
- url = "http://ecdsa/electrum",
- long_description = """Lightweight Bitcoin Wallet"""
-)