Skip to content

Commit

Permalink
Merge pull request #380 from CortexFoundation/dev
Browse files Browse the repository at this point in the history
potential panic fix
  • Loading branch information
ucwong authored Jun 15, 2023
2 parents 06409ca + d285c74 commit 9f6fcb9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/chaindb.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ func (fs *ChainDB) addLeaf(block *types.Block, mes bool, dup bool) error {
number := block.Number
leaf := merkletree.NewContent(block.Hash.String(), number)

if fs.tree == nil {
return errors.New("mkt is nil")
}

l, e := fs.tree.VerifyContent(leaf)
if !l {
if !dup {
Expand Down

0 comments on commit 9f6fcb9

Please sign in to comment.