mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Supposing there are 2 different addresses to be placed in an addrman table. During every test run, a different [bucket,position] would be calculated for each address. These calculated [bucket,position] could end up being the same for the 2 different addresses in some test runs and result in collisions in the addrman. We wouldn't be able to predict when the collisions are going to happen because we can't predict the nKey value which is chosen at random. This can cause flaky tests. Improve this by allowing deterministic addrman creation in the functional tests. This creates an addrman with fixed `nKey` = 1 and we can know the [bucket,position] collisions beforehand, safely add more addresses in an addrman table and write more extensive tests.