mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-14 00:59:33 +00:00
[DEV-189] Fixed blockSet.highest() case when highest==nil
This commit is contained in:
parent
ab7d9f2fa7
commit
faf5efa455
@ -38,7 +38,7 @@ func (bs blockSet) maxHeight() int32 {
|
|||||||
func (bs blockSet) highest() *blockNode {
|
func (bs blockSet) highest() *blockNode {
|
||||||
var highest *blockNode
|
var highest *blockNode
|
||||||
for _, node := range bs {
|
for _, node := range bs {
|
||||||
if highest.height < node.height || daghash.Less(&node.hash, &highest.hash) {
|
if highest == nil || highest.height < node.height || daghash.Less(&node.hash, &highest.hash) {
|
||||||
highest = node
|
highest = node
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user