broadcast version number
[electrum-server.git] / backends / irc / __init__.py
index 28e60d9..9c8bfe2 100644 (file)
@@ -5,7 +5,7 @@ def random_string(N):
     return ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(N))
 
 from processor import Processor
-
+from version import VERSION
 
 class IrcThread(threading.Thread):
 
@@ -25,7 +25,7 @@ class IrcThread(threading.Thread):
 
 
     def getname(self):
-        s = ''
+        s = 'v' + VERSION + ' '
         if self.stratum_tcp_port:
             s += 't' + self.stratum_tcp_port + ' ' 
         if self.stratum_http_port:
@@ -144,6 +144,10 @@ 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()