From 71c19915c0c716d6f8a539dd92b8ad41e8c447ee Mon Sep 17 00:00:00 2001 From: stratospher <44024636+stratospher@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:56:00 +0530 Subject: [PATCH] [test] Use deterministic addrman in addpeeraddress test this test inserts 1 address into the new table and 1 address into the tried table so that no collisions can happen in either table if a second address is added. this setup does not need to be maintained anymore since we can use a deterministic addrman and safely add many addresses in both tables without collisions. Remove comment explaining why previous setup needed to be maintained. --- test/functional/rpc_net.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py index e1820b0f55..a824228c35 100755 --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -299,16 +299,8 @@ class NetTest(BitcoinTestFramework): assert_raises_rpc_error(-8, "Network not recognized: Foo", self.nodes[0].getnodeaddresses, 1, "Foo") def test_addpeeraddress(self): - """RPC addpeeraddress sets the source address equal to the destination address. - If an address with the same /16 as an existing new entry is passed, it will be - placed in the same new bucket and have a 1/64 chance of the bucket positions - colliding (depending on the value of nKey in the addrman), in which case the - new address won't be added. The probability of collision can be reduced to - 1/2^16 = 1/65536 by using an address from a different /16. We avoid this here - by first testing adding a tried table entry before testing adding a new table one. - """ self.log.info("Test addpeeraddress") - self.restart_node(1, ["-checkaddrman=1"]) + self.restart_node(1, ["-checkaddrman=1", "-test=addrman"]) node = self.nodes[1] self.log.debug("Test that addpeerinfo is a hidden RPC")