@@ -45,7 +45,7 @@ def run_test(self):
45
45
self .test_no_banning ()
46
46
47
47
# Lets restart masternodes with closed ports and verify that they get banned even though they are connected to other MNs (via outbound connections)
48
- self .test_banning (self .close_mn_port , 3 )
48
+ self .test_banning (self .close_mn_port )
49
49
self .deaf_mns .clear ()
50
50
51
51
self .repair_masternodes (True )
@@ -158,7 +158,7 @@ def mine_quorum_less_checks(self, expected_good_nodes, mninfos_online):
158
158
159
159
return new_quorum
160
160
161
- def test_banning (self , invalidate_proc , expected_connections ):
161
+ def test_banning (self , invalidate_proc , expected_connections = None ):
162
162
mninfos_online = self .mninfo .copy ()
163
163
mninfos_valid = self .mninfo .copy ()
164
164
expected_contributors = len (mninfos_online )
@@ -173,11 +173,13 @@ def test_banning(self, invalidate_proc, expected_connections):
173
173
# NOTE: Min PoSe penalty is 100 (see CDeterministicMNList::CalcMaxPoSePenalty()),
174
174
# so nodes are PoSe-banned in the same DKG they misbehave without being PoSe-punished first.
175
175
if instant_ban :
176
+ assert expected_connections is not None
176
177
self .reset_probe_timeouts ()
177
178
self .mine_quorum (expected_connections = expected_connections , expected_members = expected_contributors , expected_contributions = expected_contributors , expected_complaints = expected_complaints , expected_commitments = expected_contributors , mninfos_online = mninfos_online , mninfos_valid = mninfos_valid )
178
179
else :
179
180
# It's ok to miss probes/quorum connections up to 5 times.
180
181
# 6th time is when it should be banned for sure.
182
+ assert expected_connections is None
181
183
for _ in range (6 ):
182
184
self .reset_probe_timeouts ()
183
185
self .mine_quorum_less_checks (expected_contributors - 1 , mninfos_online )
0 commit comments