mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
[NOD-162] Fixed calculateNodeHeight not handling the genesis block. (#291)
This commit is contained in:
parent
39ccc4b225
commit
42109ec4d5
@ -142,6 +142,9 @@ func initBlockNode(node *blockNode, blockHeader *wire.BlockHeader, parents block
|
||||
}
|
||||
|
||||
func calculateNodeHeight(node *blockNode) uint64 {
|
||||
if node.isGenesis() {
|
||||
return 0
|
||||
}
|
||||
return node.parents.maxHeight() + 1
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user