Skip to content

Commit

Permalink
bugfix: No need to return an error if block is already appended
Browse files Browse the repository at this point in the history
Returning error here on some cases when we had unclean shutdown would prevent
the chain from progressing. I am referring to a specific scenario where If sub
has already appended the block on stop and dom hasn't
  • Loading branch information
gameofpointers committed Sep 29, 2023
1 parent e7f6f96 commit 4024a36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (sl *Slice) Append(header *types.Header, domPendingHeader *types.Header, do
// Don't append the block which already exists in the database.
if sl.hc.HasHeader(header.Hash(), header.NumberU64()) && (sl.hc.GetTerminiByHash(header.Hash()) != nil) {
log.Debug("Block has already been appended: ", "Hash: ", header.Hash())
return nil, false, false, ErrKnownBlock
return nil, false, false, nil
}
time1 := common.PrettyDuration(time.Since(start))
// This is to prevent a crash when we try to insert blocks before domClient is on.
Expand Down

0 comments on commit 4024a36

Please sign in to comment.