chaindb: minor.
This commit is contained in:
parent
244af663bb
commit
967449b0d5
@ -933,6 +933,9 @@ ChainDB.prototype.getFullBlock = co(function* getFullBlock(hash) {
|
|||||||
view = new CoinView();
|
view = new CoinView();
|
||||||
undo = yield this.getUndoCoins(block.hash());
|
undo = yield this.getUndoCoins(block.hash());
|
||||||
|
|
||||||
|
if (undo.isEmpty())
|
||||||
|
return block;
|
||||||
|
|
||||||
for (i = block.txs.length - 1; i > 0; i--) {
|
for (i = block.txs.length - 1; i > 0; i--) {
|
||||||
tx = block.txs[i];
|
tx = block.txs[i];
|
||||||
for (j = tx.inputs.length - 1; j >= 0; j--) {
|
for (j = tx.inputs.length - 1; j >= 0; j--) {
|
||||||
@ -942,7 +945,7 @@ ChainDB.prototype.getFullBlock = co(function* getFullBlock(hash) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Undo coins should be empty.
|
// Undo coins should be empty.
|
||||||
assert(undo.items.length === 0, 'Undo coins data inconsistency.');
|
assert(undo.isEmpty(), 'Undo coins data inconsistency.');
|
||||||
|
|
||||||
return block;
|
return block;
|
||||||
});
|
});
|
||||||
@ -1759,7 +1762,7 @@ ChainDB.prototype.disconnectBlock = co(function* disconnectBlock(block) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Undo coins should be empty.
|
// Undo coins should be empty.
|
||||||
assert(undo.items.length === 0, 'Undo coins data inconsistency.');
|
assert(undo.isEmpty(), 'Undo coins data inconsistency.');
|
||||||
|
|
||||||
// Commit new coin state.
|
// Commit new coin state.
|
||||||
this.saveView(view);
|
this.saveView(view);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user