relab / hotstuff

MIT License
167 stars 53 forks source link

Synchronizer problem #39

Closed Hang95 closed 2 years ago

Hang95 commented 2 years ago

I have some problem in synchronizer/synchronizer.go

func (s *Synchronizer) AdvanceView(syncInfo consensus.SyncInfo) {
    v := consensus.View(0)
    timeout := false

    // check for a TC
    if tc, ok := syncInfo.TC(); ok {
        if !s.mods.Crypto().VerifyTimeoutCert(tc) {
            s.mods.Logger().Info("Timeout Certificate could not be verified!")
            return
        }
        if v > s.highTC.View() {
            s.highTC = tc
        }

        v = tc.View()
        timeout = true
    }

I think v is always 0 when compare to s.highTC.View() shuold we put v = tc.View() before that?

johningve commented 2 years ago

Thanks for spotting this mistake!