chain: add genesis check.
This commit is contained in:
parent
0f8fd1dc77
commit
5e1d8c743c
@ -1143,6 +1143,12 @@ Chain.prototype._add = co(function* add(block) {
|
||||
// Mark the start time.
|
||||
this.mark();
|
||||
|
||||
// Special case for genesis block.
|
||||
if (hash === this.network.genesis.hash) {
|
||||
this.emit('exists', block, block.getCoinbaseHeight());
|
||||
throw new VerifyError(block, 'duplicate', 'duplicate', 0);
|
||||
}
|
||||
|
||||
// Do we already have this block in the queue?
|
||||
if (this.hasPending(hash)) {
|
||||
this.emit('exists', block, block.getCoinbaseHeight());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user