use stable sort for chain sorting

the default non-stable sort may reorder chains with the same gasPerf, which might change the order
of messages per nonce; facepalm.
This commit is contained in:
vyzo 2020-08-06 17:40:22 +03:00
parent 16a1f9b682
commit 7a8c74fee8
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ func (mp *MessagePool) pruneMessages(ctx context.Context, ts *types.TipSet) erro
}
// Sort the chains
sort.Slice(chains, func(i, j int) bool {
sort.SliceStable(chains, func(i, j int) bool {
return chains[i].Before(chains[j])
})

View File

@ -60,7 +60,7 @@ func (mp *MessagePool) selectMessages(curTs, ts *types.TipSet) ([]*types.SignedM
}
// 2. Sort the chains
sort.Slice(chains, func(i, j int) bool {
sort.SliceStable(chains, func(i, j int) bool {
return chains[i].Before(chains[j])
})