0

What does the bitcoin protocol do to handle collisions when adding addresses to the new table?

3
  • 1
    What addresses and what new table? Oct 8, 2022 at 20:26
  • The addresses that are in the addr message are placed into the new table of bitcoin core. Oct 8, 2022 at 20:29
  • Surely addr entries can't collide because there is no expectation that each peer has no peers in common. If two peers report a common addr entry wouldn't you just keep the common value in your table? Oct 8, 2022 at 20:53

1 Answer 1

1

In case of a collision of addrs in the new table, the existing address will normally stay (and nothing changes) - unless

  • the existing entry is already present somewhere else in the new table (an address can be in up to 8 different buckets/positions at the same time), or
  • if the existing entry is of bad quality ("terrible")

In these two cases the existing entry will be replaced by the new one. There are several criteria by which a node can be terrible, roughly:

  • if its timestamp is too far in the future or too far in the past from the current time.
  • if we unsuccessfully tried to connect to it too often in the past

See Addrman::IsTerrible() for details / exact limits. It may also be worth to mention that the behavior in case of collisions in the tried table is very different from this ("test before evict").

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.