fix loop.
This commit is contained in:
parent
9fd3bbb827
commit
d9761fbe16
@ -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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user