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

Commit

Permalink
fix: use callback in start from js-libp2p (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
generalpiston authored and vasco-santos committed Jul 31, 2019
1 parent 8f90e44 commit 74c305d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict'

const nextTick = require('async/nextTick')
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
const multiaddr = require('multiaddr')
Expand Down Expand Up @@ -31,15 +32,19 @@ class Bootstrap extends EventEmitter {

/**
* Start emitting events.
*
* @param {Function} cb - callback indicating completion
*/
start () {
start (cb) {
if (this._timer) {
return
}

this._timer = setInterval(() => this._discoverBootstrapPeers(), this._interval)

this._discoverBootstrapPeers()

cb && nextTick(() => cb())
}

/**
Expand Down

0 comments on commit 74c305d

Please sign in to comment.