Skip to content

Commit

Permalink
change workingtree start leaf count in force
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-cha committed Nov 21, 2024
1 parent c71228a commit 9ace9c7
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions executor/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,23 @@ func Migration0191(db types.DB) error {
return true, err
}

if workingTree.Done && workingTree.LeafCount != 0 {
if nextSequence != workingTree.StartLeafIndex {
changeWorkingTree = true
}
if nextSequence != workingTree.StartLeafIndex {
changeWorkingTree = true
}

if changeWorkingTree {
workingTree.StartLeafIndex = nextSequence
workingTreeBz, err := json.Marshal(workingTree)
if err != nil {
return true, err
}
err = merkleDB.Set(key, workingTreeBz)
if err != nil {
return true, err
}
if changeWorkingTree {
workingTree.StartLeafIndex = nextSequence
workingTreeBz, err := json.Marshal(workingTree)
if err != nil {
return true, err
}
err = merkleDB.Set(key, workingTreeBz)
if err != nil {
return true, err
}
}

if workingTree.Done && workingTree.LeafCount != 0 {
data, err := json.Marshal(executortypes.TreeExtraData{
BlockNumber: types.MustUint64ToInt64(version),
})
Expand Down

0 comments on commit 9ace9c7

Please sign in to comment.