return chainwork correctly for genesis block.
This commit is contained in:
parent
e2759707f2
commit
2fd490922b
@ -58,7 +58,7 @@ ChainBlock.prototype.getChainwork = function getChainwork() {
|
|||||||
// Workaround for genesis block
|
// Workaround for genesis block
|
||||||
// being added _in_ chaindb.
|
// being added _in_ chaindb.
|
||||||
if (!this.chain.db)
|
if (!this.chain.db)
|
||||||
return;
|
return this.getProof();
|
||||||
|
|
||||||
prev = this.prev;
|
prev = this.prev;
|
||||||
|
|
||||||
|
|||||||
@ -359,7 +359,8 @@ ChainDB.prototype.saveSync = function saveSync(entry) {
|
|||||||
assert(entry.height >= 0);
|
assert(entry.height >= 0);
|
||||||
|
|
||||||
if (entry.height * BLOCK_SIZE !== this.size) {
|
if (entry.height * BLOCK_SIZE !== this.size) {
|
||||||
utils.debug('Warning attempt to write to height: %d/%d', this.height);
|
utils.debug('Warning attempt to write to height: %d/%d',
|
||||||
|
entry.height, this.getSize() - 1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,7 +386,8 @@ ChainDB.prototype.saveAsync = function saveAsync(entry, callback) {
|
|||||||
assert(entry.height >= 0);
|
assert(entry.height >= 0);
|
||||||
|
|
||||||
if (entry.height * BLOCK_SIZE !== this.size) {
|
if (entry.height * BLOCK_SIZE !== this.size) {
|
||||||
utils.debug('Warning attempt to write to height: %d/%d', this.height);
|
utils.debug('Warning attempt to write to height: %d/%d',
|
||||||
|
entry.height, this.getSize() - 1);
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user