From 100da5eb331d57966be1c3e721f9c291c4addc42 Mon Sep 17 00:00:00 2001 From: Kristaps Kaupe Date: Sat, 10 Feb 2024 02:09:46 +0200 Subject: [PATCH] Handle JsonRpcError in _estimate_fee_basic --- src/jmclient/blockchaininterface.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jmclient/blockchaininterface.py b/src/jmclient/blockchaininterface.py index d9ae28b1e..3ee6efaa3 100644 --- a/src/jmclient/blockchaininterface.py +++ b/src/jmclient/blockchaininterface.py @@ -593,8 +593,12 @@ def _estimate_fee_basic(self, # cannot be estimated in that case the 2nd highest priority # should be used instead of falling back to hardcoded values tries = 2 if conf_target == 1 else 1 + rpc_result = None for i in range(tries): - rpc_result = self._rpc('estimatesmartfee', [conf_target + i]) + try: + rpc_result = self._rpc('estimatesmartfee', [conf_target + i]) + except JsonRpcError: + continue if not rpc_result: # in case of connection error: return None