aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_disconnect_ban.py
diff options
context:
space:
mode:
authorbrunoerg <brunoely.gc@gmail.com>2022-01-06 15:33:43 -0300
committerbrunoerg <brunoely.gc@gmail.com>2022-01-06 15:33:43 -0300
commitc9374af10227be3e4c9d4fb5fbd1027841361f14 (patch)
tree42ac3cde7b77cd64a4db2b0e160124fae6ced9bf /test/functional/p2p_disconnect_ban.py
parent3917dff732b48e1b994dc199f91d11e9074e449f (diff)
test: set ban after mocking time
Diffstat (limited to 'test/functional/p2p_disconnect_ban.py')
-rwxr-xr-xtest/functional/p2p_disconnect_ban.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/p2p_disconnect_ban.py b/test/functional/p2p_disconnect_ban.py
index 721a5a4c57..7284ecde83 100755
--- a/test/functional/p2p_disconnect_ban.py
+++ b/test/functional/p2p_disconnect_ban.py
@@ -57,11 +57,11 @@ class DisconnectBanTest(BitcoinTestFramework):
assert_equal(len(self.nodes[1].listbanned()), 0)
self.log.info("setban: test persistence across node restart")
- self.nodes[1].setban("127.0.0.0/32", "add")
- self.nodes[1].setban("127.0.0.0/24", "add")
# Set the mocktime so we can control when bans expire
old_time = int(time.time())
self.nodes[1].setmocktime(old_time)
+ self.nodes[1].setban("127.0.0.0/32", "add")
+ self.nodes[1].setban("127.0.0.0/24", "add")
self.nodes[1].setban("192.168.0.1", "add", 1) # ban for 1 seconds
self.nodes[1].setban("2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/19", "add", 1000) # ban for 1000 seconds
listBeforeShutdown = self.nodes[1].listbanned()