Skip to content

Commit e8f3033

Browse files
committed
fixes
1 parent 6c788b1 commit e8f3033

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pkg/store/store_adapter.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ func (a *StoreAdapter[H]) Head(ctx context.Context, _ ...header.HeadOption[H]) (
245245
return pendingHead, nil
246246
}
247247

248-
// Return ErrEmptyStore (not ErrNotFound) when store is empty.
249-
// The go-header syncer specifically checks for ErrEmptyStore to trigger initialization.
250248
return zero, header.ErrEmptyStore
251249
}
252250

@@ -262,8 +260,6 @@ func (a *StoreAdapter[H]) Tail(ctx context.Context) (H, error) {
262260
// Check store
263261
h, err := a.getter.Height(ctx)
264262
if err != nil || h == 0 {
265-
// Return ErrEmptyStore (not ErrNotFound) when store is empty.
266-
// The go-header syncer specifically checks for ErrEmptyStore to handle empty stores.
267263
return zero, header.ErrEmptyStore
268264
}
269265
height = h
@@ -291,7 +287,8 @@ func (a *StoreAdapter[H]) Tail(ctx context.Context) (H, error) {
291287
}
292288
}
293289

294-
return zero, header.ErrNotFound
290+
// shoud never happen
291+
return zero, header.ErrEmptyStore
295292
}
296293

297294
// Get returns an item by its hash.

0 commit comments

Comments
 (0)