diff --git a/pkg/services/tree/service.go b/pkg/services/tree/service.go index edea450f1..7ab8fd13c 100644 --- a/pkg/services/tree/service.go +++ b/pkg/services/tree/service.go @@ -531,9 +531,13 @@ func (s *Service) GetOpLog(req *GetOpLogRequest, srv TreeService_GetOpLogServer) } h := b.GetHeight() + lastHeight, err := s.forest.TreeHeight(cid, b.GetTreeId()) + if err != nil { + return err + } for { lm, err := s.forest.TreeGetOpLog(cid, b.GetTreeId(), h) - if err != nil || lm.Time == 0 { + if err != nil || lm.Time == 0 || lastHeight < lm.Time { return err }