Skip to content

Commit

Permalink
Merge branch 'kishan/fix/syncing' of github.com:ChainSafe/gossamer in…
Browse files Browse the repository at this point in the history
…to kishan/fix/syncing
  • Loading branch information
kishansagathiya committed Feb 14, 2023
2 parents 8e8756a + 2cf149b commit 89dce6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions dot/state/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,13 @@ func (bs *BlockState) GetAllDescendants(hash common.Hash) ([]common.Hash, error)
}

for _, nextBlockHash := range nextBlockHashes {

nextHeader, err := bs.GetHeader(nextBlockHash)
if err != nil {
return nil, fmt.Errorf("getting header from block hash %s: %w", nextBlockHash, err)
}
// next block is not a descendant of the block for the given hash
if nextHeader.ParentHash != hash {
return nil, nil
return []common.Hash{hash}, nil
}

nextDescendants, err := bs.bt.GetAllDescendants(nextBlockHash)
Expand Down
2 changes: 1 addition & 1 deletion lib/blocktree/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/require"
)

var zeroHash, _ = common.HexToHash("0x00")
var zeroHash = common.MustHexToHash("0x00")
var testHeader = &types.Header{
ParentHash: zeroHash,
Number: 0,
Expand Down

0 comments on commit 89dce6d

Please sign in to comment.