Merge pull request #277 from filecoin-project/fix/bitfield-deterministic

Sort the result of All in bitfiled
This commit is contained in:
Łukasz Magiera
2019-10-04 20:25:55 +02:00
committed by GitHub
+3
View File
@@ -3,6 +3,7 @@ package types
import (
"fmt"
"io"
"sort"
"github.com/filecoin-project/go-lotus/extern/rleplus"
cbg "github.com/whyrusleeping/cbor-gen"
@@ -47,6 +48,8 @@ func (bf BitField) All() []uint64 {
for i := range bf.bits {
res = append(res, i)
}
sort.Slice(res, func(i, j int) bool { return res[i] < res[j] })
return res
}