refactored jsonrpc: broke generic jsonrpc handling out of HTTP-specific implementatio...
[p2pool.git] / p2pool / main.py
index 1f09ae3..998b426 100644 (file)
@@ -47,7 +47,7 @@ def main(args, net, datadir_path, merged_urls, worker_endpoint):
         # connect to bitcoind over JSON-RPC and do initial getmemorypool
         url = '%s://%s:%i/' % ('https' if args.bitcoind_rpc_ssl else 'http', args.bitcoind_address, args.bitcoind_rpc_port)
         print '''Testing bitcoind RPC connection to '%s' with username '%s'...''' % (url, args.bitcoind_rpc_username)
-        bitcoind = jsonrpc.Proxy(url, dict(Authorization='Basic ' + base64.b64encode(args.bitcoind_rpc_username + ':' + args.bitcoind_rpc_password)), timeout=30)
+        bitcoind = jsonrpc.HTTPProxy(url, dict(Authorization='Basic ' + base64.b64encode(args.bitcoind_rpc_username + ':' + args.bitcoind_rpc_password)), timeout=30)
         yield helper.check(bitcoind, net)
         temp_work = yield helper.getwork(bitcoind)
         
@@ -433,6 +433,8 @@ def run():
     if args.debug:
         p2pool.DEBUG = True
         defer.setDebugging(True)
+    else:
+        p2pool.DEBUG = False
     
     net_name = args.net_name + ('_testnet' if args.testnet else '')
     net = networks.nets[net_name]