mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
Merge bitcoin/bitcoin#23996: test: set ban after mocking time
c9374af102
test: set ban after mocking time (brunoerg) Pull request description: Fixes #23988 Set ban after mocking time to avoid intermittent failures related to the assertion of ban_duration and time_remaining. See: https://cirrus-ci.com/task/6754020390862848?logs=ci#L4652 ACKs for top commit: mzumsande: Tested ACKc9374af102
vincenzopalazzo: ACKc9374af102
Tree-SHA512: fac3ac91a045bb46334d7c568f6a53a3b0a45b306914a54ea13bcc845734eaaad1ff295ff3ab158037fd9d08df77344058331336110b8f7888832b16b0589be5
This commit is contained in:
commit
be72ae25a8
1 changed files with 2 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue