Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Waiting 10s BEFORE discovering bootstrap nodes? #85

Closed
@alanshaw

Description

@alanshaw

Shouldn't we discover on start instead of setting an interval and initially discovering after 10s? Looks like this is the main issue behind ipfs/js-ipfs#1706

this._timer = setInterval(() => {
this._list.forEach((candidate) => {
if (!isIPFS(candidate)) { return log.error('Invalid multiaddr') }
const ma = multiaddr(candidate)
const peerId = PeerId.createFromB58String(ma.getPeerId())
PeerInfo.create(peerId, (err, peerInfo) => {
if (err) { return log.error('Invalid bootstrap peer id', err) }
peerInfo.multiaddrs.add(ma)
this.emit('peer', peerInfo)
})
})
}, this._interval)

Here we set an interval, which triggers initially after 10s.

refs #72

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions