From 8ad3af713196ec29cfa68d03c2e3d374de3134bc Mon Sep 17 00:00:00 2001 From: aitbc Date: Mon, 20 Apr 2026 21:43:01 +0200 Subject: [PATCH] fix: handle closing parenthesis in gap size parsing - Add .replace(")", "") to received_height parsing - Fixes ValueError when parsing '9007)' as integer - Auto sync was failing due to parsing bug in main.py - Reason format: 'Gap detected (our height: 8175, received: 9007)' --- apps/blockchain-node/src/aitbc_chain/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/blockchain-node/src/aitbc_chain/main.py b/apps/blockchain-node/src/aitbc_chain/main.py index e7c5672b..65a37288 100755 --- a/apps/blockchain-node/src/aitbc_chain/main.py +++ b/apps/blockchain-node/src/aitbc_chain/main.py @@ -145,7 +145,7 @@ class BlockchainNode: try: reason_parts = res.reason.split(":") our_height = int(reason_parts[1].strip().split(",")[0].replace("our height: ", "")) - received_height = int(reason_parts[2].strip().replace("received: ", "")) + received_height = int(reason_parts[2].strip().replace("received: ", "").replace(")", "")) gap_size = received_height - our_height if gap_size > settings.auto_sync_threshold: