Browse Source

Handle JsonRpcError in _estimate_fee_basic

master
Kristaps Kaupe 2 years ago
parent
commit
100da5eb33
No known key found for this signature in database
GPG Key ID: 33E472FE870C7E5D
  1. 6
      src/jmclient/blockchaininterface.py

6
src/jmclient/blockchaininterface.py

@ -593,8 +593,12 @@ class BitcoinCoreInterface(BlockchainInterface):
# 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

Loading…
Cancel
Save