stop the server if abe fails
[electrum-server.git] / backends / irc / __init__.py
index 87b6fa0..5d92ac1 100644 (file)
@@ -49,6 +49,7 @@ class IrcThread(threading.Thread):
                     line = sf.readline()
                     line = line.rstrip('\r\n')
                     line = line.split()
+                    if not line: continue
                     if line[0]=='PING': 
                         s.send('PONG '+line[1]+'\n')
                     elif '353' in line: # answer to /names
@@ -143,6 +144,14 @@ class ServerProcessor(Processor):
                                      "subscriptions":len(s.subscriptions)}, 
                          self.dispatcher.request_dispatcher.get_sessions())
 
+        elif method == 'server.cache':
+            p = self.dispatcher.request_dispatcher.processors['blockchain']
+            result = len(repr(p.store.tx_cache))
+
+        elif method == 'server.load':
+            p = self.dispatcher.request_dispatcher.processors['blockchain']
+            result = p.queue.qsize()
+
         else:
             print "unknown method", request