added performance improvement suggestion by @eordano
This commit is contained in:
parent
5b922915e7
commit
d76c9f0a7a
|
@ -108,11 +108,14 @@ exports.multitxs = function(req, res, next) {
|
|||
txs = txs.slice(start, end);
|
||||
}
|
||||
|
||||
var txIndex = {};
|
||||
_.each(txs, function (tx) { txIndex[tx.txid] = tx; });
|
||||
|
||||
async.each(txs, function (tx, callback) {
|
||||
tDb.fromIdWithInfo(tx.txid, function(err, tx) {
|
||||
if (err) console.log(err);
|
||||
if (tx && tx.info) {
|
||||
_.find(txs, { txid: tx.txid }).info = tx.info;
|
||||
txIndex[tx.txid].info = tx.info;
|
||||
}
|
||||
callback();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue