events: allow get on empty ts cache
This commit is contained in:
parent
f43ff07ab3
commit
6127d82c7b
@ -92,7 +92,8 @@ func (tsc *tipSetCache) getNonNull(height uint64) (*types.TipSet, error) {
|
|||||||
|
|
||||||
func (tsc *tipSetCache) get(height uint64) (*types.TipSet, error) {
|
func (tsc *tipSetCache) get(height uint64) (*types.TipSet, error) {
|
||||||
if tsc.len == 0 {
|
if tsc.len == 0 {
|
||||||
return nil, xerrors.New("tipSetCache.get: cache is empty")
|
log.Warnf("tipSetCache.get: cache is empty, requesting from storage (h=%d)", height)
|
||||||
|
return tsc.storage(context.TODO(), height, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
headH := tsc.cache[tsc.start].Height()
|
headH := tsc.cache[tsc.start].Height()
|
||||||
|
Loading…
Reference in New Issue
Block a user