aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_net.py
diff options
context:
space:
mode:
authorstratospher <44024636+stratospher@users.noreply.github.com>2023-12-21 10:56:00 +0530
committerstratospher <44024636+stratospher@users.noreply.github.com>2024-01-08 21:54:56 +0530
commit71c19915c0c716d6f8a539dd92b8ad41e8c447ee (patch)
tree042c71420d832c916b2b96724fffa75962c68d92 /test/functional/rpc_net.py
parent7b868e6b678502e86571976d696c0e3cb72c0884 (diff)
downloadbitcoin-71c19915c0c716d6f8a539dd92b8ad41e8c447ee.tar.xz
[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.
Diffstat (limited to 'test/functional/rpc_net.py')
-rwxr-xr-xtest/functional/rpc_net.py10
1 files changed, 1 insertions, 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")