diff --git a/instantout/reservation/manager.go b/instantout/reservation/manager.go index fe2952b8..037e33d3 100644 --- a/instantout/reservation/manager.go +++ b/instantout/reservation/manager.go @@ -92,7 +92,13 @@ func (m *Manager) Run(ctx context.Context, height int32, runCtx, cancel := context.WithCancel(ctx) defer cancel() + // Take the lock for the initial write so the race detector sees a + // consistent synchronisation rule (later writes in the new-block + // case already lock; concurrent reads in RequestReservationFromServer + // already lock). + m.Lock() m.currentHeight = height + m.Unlock() err := m.RecoverReservations(runCtx) if err != nil {