Browse Source

Reuse tor node function

pm2
Luke Childs 8 years ago
parent
commit
8fcb78082e
  1. 13
      lib/tor.js

13
lib/tor.js

@ -6,18 +6,7 @@ module.exports = {
.summary(query)
.then(summary => {
const nodes = summary.relays.concat(summary.bridges);
return Promise.all(nodes.map(node => onionoo.details({ lookup: node.f || node.h })));
})
.then(summaryDetails => {
return summaryDetails.map(details => {
if(details.relays[0]) {
details.relays[0].type = 'relay';
return details.relays[0];
} else if(details.bridges[0]) {
details.bridges[0].type = 'bridge';
return details.bridges[0];
}
});
return Promise.all(nodes.map(node => module.exports.node(node.f || node.h)));
});
},
node: id => {

Loading…
Cancel
Save