Skip to content

Commit 1d53f9f

Browse files
authored
fix(syncer): check tail hash via len (#309)
A non-nil but empty hash could be passed, so check the len
1 parent 0a20111 commit 1d53f9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sync/syncer_tail.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func (s *Syncer[H]) moveTail(ctx context.Context, from, to H) error {
141141
// Returns empty hash if it hasn't changed from the old tail hash.
142142
func (s *Syncer[H]) tailHash(oldTail H) (bool, header.Hash) {
143143
hash := s.Params.SyncFromHash
144-
if hash == nil {
144+
if len(hash) == 0 {
145145
return false, nil
146146
}
147147

0 commit comments

Comments
 (0)