diff --git a/bigchaindb/core.py b/bigchaindb/core.py index 295f1aae..f936bd91 100644 --- a/bigchaindb/core.py +++ b/bigchaindb/core.py @@ -118,17 +118,13 @@ class App(BaseApplication): self.abort_if_abci_chain_is_not_synced() # Check if BigchainDB supports the Tendermint version - try: - if tendermint_version_is_compatible(request.version): - logger.info(f"Tendermint version: {request.version}") - else: - logger.error(f"Error: Tendermint version {request.version} not supported." - f" Currently, BigchainDB only supports {__tm_supported_versions__}. Exiting!") - sys.exit(1) - except AttributeError: - logger.info("Tendermint version not found. Exiting!") + if not (hasattr(request, 'version') and tendermint_version_is_compatible(request.version)): + logger.error(f'Unsupported Tendermint version: {getattr(request, "version", "no version")}.' + f' Currently, BigchainDB only supports {__tm_supported_versions__}. Exiting!') sys.exit(1) + logger.info(f"Tendermint version: {request.version}") + r = ResponseInfo() block = self.bigchaindb.get_latest_block() if block: diff --git a/bigchaindb/utils.py b/bigchaindb/utils.py index 57fcc4a0..c2b6ef81 100644 --- a/bigchaindb/utils.py +++ b/bigchaindb/utils.py @@ -205,5 +205,4 @@ def tendermint_version_is_compatible(running_tm_ver): for ver in __tm_supported_versions__: if version.parse(ver) == version.parse(tm_ver[0]): return True - else: - return False + return False