diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2014-02-01 07:55:03 +0400 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2014-02-01 07:55:03 +0400 |
commit | d6ffcc5d757c2dfdce13275998c8d23cdb4a9bd9 (patch) | |
tree | e146e36b83d8d29a2a34992bb2783db993dc62ae | |
parent | 53cf325eba0016dd3c91c52987e6626679e795c0 (diff) |
fix scope bug
-rw-r--r-- | index.js | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -65,6 +65,9 @@ var displayName = magnetToDisplayName(magnetUri) $('.infoHash span').text(infoHash) $('.displayName span').text(displayName) +var dht +var swarm + async.auto({ dhtPort: function (cb) { portfinder.getPort(cb) @@ -73,7 +76,7 @@ async.auto({ portfinder.getPort(cb) }, dht: ['dhtPort', function (cb, r) { - var dht = new DHT(infoHash) + dht = new DHT(infoHash) dht.on('node', function (node, infoHash) { var num = Number($('.dhtNodes span').text()) @@ -94,7 +97,7 @@ async.auto({ // dht.listen(r.dhtPort) }], swarm: ['swarmPort', function (cb, r) { - var swarm = new Swarm(infoHash, peerId, { dht: true }) + swarm = new Swarm(infoHash, peerId, { dht: true }) // TODO: add swarm listen and add ourselves to the DHT |