diff --git a/chain/messagepool/pruning.go b/chain/messagepool/pruning.go index 11719049d..a4dce3e6d 100644 --- a/chain/messagepool/pruning.go +++ b/chain/messagepool/pruning.go @@ -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]) }) diff --git a/chain/messagepool/selection.go b/chain/messagepool/selection.go index e2cc797b9..e14efe8d1 100644 --- a/chain/messagepool/selection.go +++ b/chain/messagepool/selection.go @@ -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]) })