fix: handle closing parenthesis in gap size parsing
Some checks failed
Integration Tests / test-service-integration (push) Successful in 11s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 3s
P2P Network Verification / p2p-verification (push) Successful in 3s
Python Tests / test-python (push) Successful in 11s
Security Scanning / security-scan (push) Successful in 35s
Blockchain Synchronization Verification / sync-verification (push) Failing after 2s

- 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)'
This commit is contained in:
aitbc
2026-04-20 21:43:01 +02:00
parent 391ba4ca2e
commit 8ad3af7131

View File

@@ -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: