fix loop.

This commit is contained in:
Christopher Jeffrey 2016-04-16 20:07:02 -07:00
parent 9fd3bbb827
commit d9761fbe16
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -827,7 +827,7 @@ ChainDB.prototype.connectBlock = function connectBlock(block, batch, callback) {
batch.del('u/t/' + key);
}
for (j = 0; j < tx.inputs.length; j++) {
for (j = 0; j < tx.outputs.length; j++) {
output = tx.outputs[j];
key = hash + '/' + j;
@ -874,11 +874,6 @@ ChainDB.prototype.disconnectBlock = function disconnectBlock(block, batch, callb
if (!block)
return callback(new Error('Block not found.'));
if (self.options.paranoid) {
if (typeof block === 'string')
assert(block.hash('hex') === block, 'Database is corrupt.');
}
for (i = block.txs.length - 1; i >= 0; i--) {
tx = block.txs[i];
hash = tx.hash('hex');
@ -908,7 +903,7 @@ ChainDB.prototype.disconnectBlock = function disconnectBlock(block, batch, callb
batch.put('u/t/' + key, input.coin.toRaw());
}
for (j = 0; j < tx.inputs.length; j++) {
for (j = 0; j < tx.outputs.length; j++) {
output = tx.outputs[j];
key = hash + '/' + j;