Skip to content

Commit

Permalink
fixed a small bug in the Report function (maticnetwork#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikspatil024 authored Sep 27, 2022
1 parent 40f0ff1 commit 866a2b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/blockstm/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,19 @@ func BuildDAG(deps TxnInputOutput) (d DAG) {
func (d DAG) Report(out func(string)) {
roots := make([]int, 0)
rootIds := make([]string, 0)
rootIdMap := make(map[int]string, len(d.GetRoots()))

for k, i := range d.GetRoots() {
roots = append(roots, i.(int))
rootIds = append(rootIds, k)
rootIdMap[i.(int)] = k
}

sort.Ints(roots)

for _, i := range roots {
rootIds = append(rootIds, rootIdMap[i])
}

fmt.Println(roots)

makeStrs := func(ints []int) (ret []string) {
Expand Down

0 comments on commit 866a2b7

Please sign in to comment.