diff --git a/package.json b/package.json index c45920a..198ed99 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/diasdavid/node-libp2p-kad-routing", "dependencies": { - "async": "^1.4.0", + "async": "^2.0.1", "buffer-xor": "^1.0.2", "ipfs-logger": "^0.1.0", "js-priority-queue": "^0.1.2", diff --git a/src/index.js b/src/index.js index b7d5090..f4df74e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ var KBucket = require('k-bucket') -var async = require('async') +var queue = require('async/queue') var log = require('ipfs-logger').group('peer-routing ipfs-kad-router') var protobufs = require('protocol-buffers-stream') var fs = require('fs') @@ -84,7 +84,7 @@ function KadRouter (peerSelf, swarmSelf, kBucketSize) { var peerList = {} // < b58Id : Peer > - var q = async.queue(queryPeer, 1) + var q = queue(queryPeer, 1) var closerPeers = self.kb.closest({ id: key, // key must be an Id object exported with .toBytes()