File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -62,17 +62,22 @@ def _connected(end="\n"):
6262 tanks = get_mission ("tank" )
6363 for tank in tanks :
6464 # Get actual
65- peerinfo = json .loads (_rpc (tank .metadata .name , "getpeerinfo" , "" ))
66- actual = 0
67- for peer in peerinfo :
68- if is_connection_manual (peer ):
69- actual += 1
70- expected = int (tank .metadata .annotations ["init_peers" ])
71- print (f"Tank { tank .metadata .name } peers expected: { expected } , actual: { actual } " , end = end )
72- # Even if more edges are specified, bitcoind only allows
73- # 8 manual outbound connections
74- if min (8 , expected ) > actual :
75- print ("\n Network not connected" )
65+ try :
66+ peerinfo = json .loads (_rpc (tank .metadata .name , "getpeerinfo" , "" ))
67+ actual = 0
68+ for peer in peerinfo :
69+ if is_connection_manual (peer ):
70+ actual += 1
71+ expected = int (tank .metadata .annotations ["init_peers" ])
72+ print (
73+ f"Tank { tank .metadata .name } peers expected: { expected } , actual: { actual } " , end = end
74+ )
75+ # Even if more edges are specified, bitcoind only allows
76+ # 8 manual outbound connections
77+ if min (8 , expected ) > actual :
78+ print ("\n Network not connected" )
79+ return False
80+ except Exception :
7681 return False
7782 print ("Network connected " )
7883 return True
You can’t perform that action at this time.
0 commit comments