From 3f88b80bc0dda5123019e6114472fcbd225c1d91 Mon Sep 17 00:00:00 2001 From: djkabutar Date: Fri, 15 Dec 2023 16:01:40 +0530 Subject: [PATCH] authproxy: fix batch operations while doing 1 op Signed-off-by: djkabutar --- bitcoinrpc/authproxy.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bitcoinrpc/authproxy.py b/bitcoinrpc/authproxy.py index abebe4b..e53e211 100644 --- a/bitcoinrpc/authproxy.py +++ b/bitcoinrpc/authproxy.py @@ -166,11 +166,10 @@ def batch_(self, rpc_calls): 'Content-type': 'application/json'}) results = [] responses = self._get_response() - if isinstance(responses, (dict,)): - if ('error' in responses) and (responses['error'] is not None): - raise JSONRPCException(responses['error']) - raise JSONRPCException({ - 'code': -32700, 'message': 'Parse error'}) + + if type(responses) != list: + responses = [responses] + for response in responses: if response['error'] is not None: raise JSONRPCException(response['error'])