Skip to content

Commit

Permalink
fix: dont call the callback more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Apr 16, 2017
1 parent f1ede87 commit 54eafb3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const EventEmitter = require('events').EventEmitter
const debug = require('debug')
const series = require('async/series')
const map = require('async/map')
const once = require('once')

const CONSTANTS = require('./constants')
const WantManager = require('./components/want-manager')
Expand Down Expand Up @@ -181,6 +182,7 @@ class Bitswap {
* @returns {void}
*/
getMany (cids, callback) {
callback = once(callback)
const unwantListeners = {}
const blockListeners = {}
const unwantEvent = (c) => `unwant:${c}`
Expand Down

0 comments on commit 54eafb3

Please sign in to comment.