chaindb: optimize coin size checking.
This commit is contained in:
parent
dfdee526db
commit
0b24daba31
@ -880,7 +880,7 @@ ChainDB.prototype.connectBlock = function connectBlock(block, view, batch, callb
|
|||||||
|
|
||||||
for (i = 0; i < view.length; i++) {
|
for (i = 0; i < view.length; i++) {
|
||||||
coins = view[i];
|
coins = view[i];
|
||||||
if (coins.count() === 0) {
|
if (coins.size() === 0) {
|
||||||
batch.del(layout.c(coins.hash));
|
batch.del(layout.c(coins.hash));
|
||||||
this.coinCache.remove(coins.hash);
|
this.coinCache.remove(coins.hash);
|
||||||
} else {
|
} else {
|
||||||
@ -976,7 +976,7 @@ ChainDB.prototype.disconnectBlock = function disconnectBlock(block, batch, callb
|
|||||||
|
|
||||||
for (i = 0; i < view.length; i++) {
|
for (i = 0; i < view.length; i++) {
|
||||||
coins = view[i];
|
coins = view[i];
|
||||||
if (coins.count() === 0) {
|
if (coins.size() === 0) {
|
||||||
batch.del(layout.c(coins.hash));
|
batch.del(layout.c(coins.hash));
|
||||||
self.coinCache.remove(coins.hash);
|
self.coinCache.remove(coins.hash);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user