Skip to content

Remove IP from addrbook if we're adding IP plus ID #1228

@melekes

Description

@melekes
2018-02-20T05:38:28Z box4450.localdomain docker/local_testnet_3[15473]: I[02-20|05:38:28.485] Added new address                            module=p2p book=/go/src/github.com
/tendermint/tendermint/test/p2p/data/mach3/core/config/addrbook.json address=fbc1209802dd5c8e0f05618efd18a581f78291b9@172.57.0.102:46656 total=2
2018-02-20T05:38:28Z box4450.localdomain docker/local_testnet_3[15473]: I[02-20|05:38:28.485] Added new address                            module=p2p book=/go/src/github.com
/tendermint/tendermint/test/p2p/data/mach3/core/config/addrbook.json address=172.57.0.102:46656 total=3

2 cases:

  1. 172.57.0.102, then fbc1209802dd5c8e0f05618efd18a581f78291b9@172.57.0.102
    We should check if IP without ID exists and just remove it after we've added ID@IP.

  2. fbc1209802dd5c8e0f05618efd18a581f78291b9@172.57.0.102, then 172.57.0.102
    Linear search for ([a-z0-9]+@)?172.57.0.102?

Refs #1214 (comment)

Metadata

Metadata

Assignees

Labels

C:p2pComponent: P2P pkg

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions