From 865bbfcf96ffd442cd6aaf306f571eb6a3fbbc04 Mon Sep 17 00:00:00 2001 From: aitbc Date: Sat, 9 May 2026 18:34:56 +0200 Subject: [PATCH] fix: always strip http:// prefix from default_peer_rpc_url before adding it back --- .../src/aitbc_chain/consensus/poa.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/blockchain-node/src/aitbc_chain/consensus/poa.py b/apps/blockchain-node/src/aitbc_chain/consensus/poa.py index 0c1772ee..21afc881 100755 --- a/apps/blockchain-node/src/aitbc_chain/consensus/poa.py +++ b/apps/blockchain-node/src/aitbc_chain/consensus/poa.py @@ -563,10 +563,15 @@ class PoAProposer: import httpx # Try multiple trusted peers - trusted_peers = [ - f"http://{self._config.default_peer_rpc_url}", - "http://localhost:8006", - ] + trusted_peers = [] + if self._config.default_peer_rpc_url: + peer_url = self._config.default_peer_rpc_url + # Remove http:// prefix if present to avoid double prefix + if peer_url.startswith("http://"): + peer_url = peer_url.replace("http://", "") + peer_url = f"http://{peer_url}" + trusted_peers.append(peer_url) + trusted_peers.append("http://localhost:8006") self._logger.info(f"Attempting RPC bootstrap from peers: {trusted_peers}")