diff --git a/lib/blockchain/chaindb.js b/lib/blockchain/chaindb.js index f8552544..d5c31dc8 100644 --- a/lib/blockchain/chaindb.js +++ b/lib/blockchain/chaindb.js @@ -1216,6 +1216,7 @@ ChainDB.prototype.scan = async function scan(start, filter, iter) { while (entry) { let block = await this.getBlock(entry.hash); let txs = []; + total++; if (!block) { @@ -1234,15 +1235,15 @@ ChainDB.prototype.scan = async function scan(start, filter, iter) { let tx = block.txs[i]; let found = false; - for (let i = 0; i < tx.outputs.length; i++) { - let output = tx.outputs[i]; + for (let j = 0; j < tx.outputs.length; j++) { + let output = tx.outputs[j]; let hash = output.getHash(); if (!hash) continue; if (filter.test(hash)) { - let prevout = Outpoint.fromTX(tx, i); + let prevout = Outpoint.fromTX(tx, j); filter.add(prevout.toRaw()); found = true; }