depth: add details to the depth error message

This commit is contained in:
c9s 2022-01-13 00:14:15 +08:00
parent 8b56c47f65
commit cb9d9137a6

View File

@ -120,7 +120,10 @@ func (b *Buffer) AddUpdate(o types.SliceOrderBook, firstUpdateID int64, finalArg
b.resetSnapshot()
b.emitReset()
b.mu.Unlock()
return fmt.Errorf("there is a missing update between %d and %d", u.FirstUpdateID, b.finalUpdateID+1)
return fmt.Errorf("found missing update between finalUpdateID %d and firstUpdateID %d, diff: %d",
b.finalUpdateID+1,
u.FirstUpdateID,
u.FirstUpdateID-b.finalUpdateID)
}
log.Debugf("depth update id %d -> %d", b.finalUpdateID, u.FinalUpdateID)