remove bccapi things; move send_tx to backend
[electrum-server.git] / StratumJSONRPCServer.py
index 15cdbf6..b595feb 100644 (file)
@@ -1,3 +1,20 @@
+#!/usr/bin/env python
+# Copyright(C) 2012 thomasv@gitorious
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with this program.  If not, see
+# <http://www.gnu.org/licenses/agpl.html>.
+
 import jsonrpclib
 from jsonrpclib import Fault
 from jsonrpclib.jsonrpc import USE_UNIX_SOCKETS
@@ -102,7 +119,7 @@ class StratumJSONRPCDispatcher(SimpleXMLRPCServer.SimpleXMLRPCDispatcher):
         params = request.get('params')
         if params is None: params=[]
         params = [ self.session_id, request['id'] ] + params
-        print method, params
+        #print method, params
         try:
             response = self._dispatch(method, params)
         except:
@@ -167,20 +184,18 @@ class StratumJSONRPCRequestHandler(
             self.report_404()
             return
         try:
-            print "GET"
-
             self.server.session_id = None
             c = self.headers.get('cookie')
             if c:
                 if c[0:8]=='SESSION=':
-                    print "found cookie", c[8:]
+                    #print "found cookie", c[8:]
                     self.server.session_id = c[8:]
 
             if self.server.session_id is None:
                 r = self.server._marshaled_single_dispatch({'method':'session.create', 'params':[], 'id':'z' })
                 r = jsonrpclib.loads(r)
                 self.server.session_id = r.get('result')
-                print "setting cookie", self.server.session_id
+                #print "setting cookie", self.server.session_id
 
             data = json.dumps([])
             response = self.server._marshaled_dispatch(data)
@@ -226,7 +241,7 @@ class StratumJSONRPCRequestHandler(
             c = self.headers.get('cookie')
             if c:
                 if c[0:8]=='SESSION=':
-                    print "found cookie", c[8:]
+                    #print "found cookie", c[8:]
                     self.server.session_id = c[8:]
 
             if self.server.session_id is None:
@@ -265,7 +280,7 @@ class StratumJSONRPCServer(SocketServer.TCPServer, StratumJSONRPCDispatcher):
     allow_reuse_address = True
 
     def __init__(self, addr, requestHandler=StratumJSONRPCRequestHandler,
-                 logRequests=True, encoding=None, bind_and_activate=True,
+                 logRequests=False, encoding=None, bind_and_activate=True,
                  address_family=socket.AF_INET):
         self.logRequests = logRequests
         StratumJSONRPCDispatcher.__init__(self, encoding)