|
|
@ -46,6 +46,9 @@ class DisconnectBanTest(BitcoinTestFramework):
|
|
|
|
assert_raises_rpc_error(-30, "Error: Invalid IP/Subnet", self.nodes[1].setban, "127.0.0.1/42", "add")
|
|
|
|
assert_raises_rpc_error(-30, "Error: Invalid IP/Subnet", self.nodes[1].setban, "127.0.0.1/42", "add")
|
|
|
|
assert_equal(len(self.nodes[1].listbanned()), 1) # still only one banned ip because 127.0.0.1 is within the range of 127.0.0.0/24
|
|
|
|
assert_equal(len(self.nodes[1].listbanned()), 1) # still only one banned ip because 127.0.0.1 is within the range of 127.0.0.0/24
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.log.info("setban: fail to ban with past absolute timestamp")
|
|
|
|
|
|
|
|
assert_raises_rpc_error(-8, "Error: Absolute timestamp is in the past", self.nodes[1].setban, "127.27.0.1", "add", 123, True)
|
|
|
|
|
|
|
|
|
|
|
|
self.log.info("setban remove: fail to unban a non-banned subnet")
|
|
|
|
self.log.info("setban remove: fail to unban a non-banned subnet")
|
|
|
|
assert_raises_rpc_error(-30, "Error: Unban failed", self.nodes[1].setban, "127.0.0.1", "remove")
|
|
|
|
assert_raises_rpc_error(-30, "Error: Unban failed", self.nodes[1].setban, "127.0.0.1", "remove")
|
|
|
|
assert_equal(len(self.nodes[1].listbanned()), 1)
|
|
|
|
assert_equal(len(self.nodes[1].listbanned()), 1)
|
|
|
|