From a51b0d21b5813b92b7a5596cce06c6b3dbb68b34 Mon Sep 17 00:00:00 2001 From: Bob Date: Thu, 6 Apr 2023 14:40:28 +0300 Subject: [PATCH] some upgrades --- config.py | 16 ---------------- rpcs.py | 34 ---------------------------------- 2 files changed, 50 deletions(-) diff --git a/config.py b/config.py index eb3bf92..d6958e9 100755 --- a/config.py +++ b/config.py @@ -68,21 +68,5 @@ fee = { 'USDT': 0.02, 'ETH': 0.06, 'XHV': 0.06 - }, - "MERCHANT": { - 'BTC': 0.01, - 'BTCLN': 0.01, - 'BTCT': 0.005, - 'LTC': 0.01, - 'BCH': 0.01, - 'DCR': 0.01, - 'DASH': 0.01, - 'XRP': 0.01, - 'DOGE': 0.01, - 'XMR': 0.01, - 'ZEC': 0.01, - 'USDT': 0.01, - 'ETH': 0.01, - 'XHV': 0.01 } } diff --git a/rpcs.py b/rpcs.py index 3210dd2..f19add5 100755 --- a/rpcs.py +++ b/rpcs.py @@ -27,40 +27,6 @@ class RPCHost(object): if not response.status_code in (200, 500): raise Exception('RPC connection failure: ' + str(response.status_code) + ' ' + response.reason) responseJSON = response.json() - if 'error' in responseJSON and responseJSON['error'] != None: - raise Exception('Error in RPC call: ' + str(responseJSON['error'])) - return responseJSON['result'] - -# class -class RPCXMR(object): - def __init__(self, url, user, password): - self._session = requests.Session() - self._url = url - self._user = user - self._pass = password - self._headers = {} - - def call(self, rpcMethod, params): - payload = json.dumps({"method": rpcMethod, "params": params, "jsonrpc": "2.0"}) - tries = 3 - hadConnectionFailures = False - while True: - try: - response = self._session.post(self._url, headers=self._headers, data=payload, auth=HTTPDigestAuth(self._user, self._pass), timeout=15) - except requests.exceptions.ConnectionError: - tries -= 1 - if tries == 0: - raise Exception('Failed to connect for remote procedure call.') - hadFailedConnections = True - print("Couldn't connect for remote procedure call, will sleep for two seconds and then try again ({} more tries)".format(tries)) - #time.sleep(2) - else: - if hadConnectionFailures: - print('Connected for remote procedure call after retry.') - break - if not response.status_code in (200, 500): - raise Exception('RPC connection failure: ' + str(response.status_code) + ' ' + response.reason) - responseJSON = response.json() if 'error' in responseJSON and responseJSON['error'] != None: raise Exception('Error in RPC call: ' + str(responseJSON['error'])) return responseJSON['result'] \ No newline at end of file -- 2.40.1