chaindb: minor.

This commit is contained in:
Christopher Jeffrey 2017-07-09 22:10:56 -07:00
parent a627f00a3f
commit 4771f2d0a8
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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;
}