From 179458efe93e868bb77135c95e52fd410e7a2bc1 Mon Sep 17 00:00:00 2001 From: frank <417329062@qq.com> Date: Mon, 6 Sep 2021 16:20:23 +0800 Subject: [PATCH] index out of range --- extern/storage-sealing/commit_batch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extern/storage-sealing/commit_batch.go b/extern/storage-sealing/commit_batch.go index 383562583dc..3a97f7d68a5 100644 --- a/extern/storage-sealing/commit_batch.go +++ b/extern/storage-sealing/commit_batch.go @@ -297,6 +297,10 @@ func (b *CommitBatcher) processBatch(cfg sealiface.Config) ([]sealiface.CommitBa infos = append(infos, p.Info) } + if len(infos) == 0 { + return nil, nil + } + sort.Slice(infos, func(i, j int) bool { return infos[i].Number < infos[j].Number })