Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug: connection with DirInbound may not have addresses in Peerstore. #316

Merged
merged 5 commits into from
Sep 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ethstorage/p2p/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (n *NodeP2P) init(resourcesCtx context.Context, rollupCfg *rollup.EsConfig,
shards map[common.Address][]uint64
remotePeerId = conn.RemotePeer()
)
if len(n.host.Peerstore().Addrs(remotePeerId)) == 0 {
if len(n.host.Peerstore().Addrs(remotePeerId)) == 0 && conn.Stat().Direction == network.DirOutbound {
ping-ke marked this conversation as resolved.
Show resolved Hide resolved
// As the node host enable NATService, which will create a new connection with another
// peer id and its Addrs will not be set to Peerstore, so if len of peer Addrs is 0,
// then ignore this connection.
Expand Down
Loading