read message from file
[electrum-server.git] / server.py
index ef84fbb..7e81d88 100644 (file)
--- a/server.py
+++ b/server.py
@@ -21,16 +21,9 @@ Todo:
    * improve txpoint sorting
 """
 
-SERVER_MESSAGE = """
-Welcome to ecdsa.org.
-
-This service is free. Support this node: 
-19mP9FKrXqL46Si58pHdhGKow88SUPy1V8
-
-The server code is free software; you may 
-download it and operate your own Electrum 
-node. See http://ecdsa.org/electrum
-"""
+f = open('/etc/electrum.conf','r')
+SERVER_MESSAGE = f.read()
+f.close()
 
 
 
@@ -289,7 +282,7 @@ def listen_thread(store):
 
 
 def client_thread(ipaddr,conn):
-    print "client thread", ipaddr
+    #print "client thread", ipaddr
     try:
         ipaddr = ipaddr[0]
         msg = ''
@@ -299,7 +292,7 @@ def client_thread(ipaddr,conn):
             if d[-1]=='#':
                 break
 
-        print msg
+        #print msg
 
         try:
             cmd, data = ast.literal_eval(msg[:-1])
@@ -314,7 +307,7 @@ def client_thread(ipaddr,conn):
         elif cmd=='session':
             import random, string
             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)
             sessions[session_id] = {}
@@ -383,7 +376,7 @@ def memorypool_update(store):
             pass
         else:
             store.import_tx(tx, False)
-            print tx['hash'][::-1].encode('hex')
+            #print tx['hash'][::-1].encode('hex')
     store.commit()
 
 import traceback
@@ -397,9 +390,9 @@ if __name__ == '__main__':
     args.connect_args = {"database":"abe"}
     store = MyStore(args)
 
-    #thread.start_new_thread(listen_thread, (store,))
-    listen_thread(store)
-    exit(0)
+    thread.start_new_thread(listen_thread, (store,))
+    #listen_thread(store)
+    #exit(0)
 
     while True:
         try: