diff options
Diffstat (limited to 'core/types/block.go')
-rw-r--r-- | core/types/block.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/types/block.go b/core/types/block.go index 55e82da..e35ab8d 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -111,6 +111,11 @@ func (b *Block) Clone() *Block { return bcopy } +// IsGenesis checks if the block is a genesisBlock +func (b *Block) IsGenesis() bool { + return b.Height == 0 && b.ParentHash == common.Hash{} +} + // ByHash is the helper type for sorting slice of blocks by hash. type ByHash []*Block |