def vote(self):
        if self.lock:
            return  # voted in this round
        self.log('in vote', proposal=self.proposal, pid=id(self.proposal))

        # get last lock on height
        last_lock = self.hm.last_lock

        if self.proposal:
            if isinstance(self.proposal, VotingInstruction):
                assert self.proposal.lockset.has_quorum_possible
                self.log('voting on instruction')
                v = VoteBlock(self.height, self.round, self.proposal.blockhash)
            elif not isinstance(last_lock, VoteBlock):
                assert isinstance(self.proposal, BlockProposal)
                assert isinstance(self.proposal.block, Block)  # already linked to chain
                assert self.proposal.lockset.has_noquorum or self.round == 0
                assert self.proposal.block.prevhash == self.cm.head.hash
                self.log('voting proposed block')
                v = VoteBlock(self.height, self.round, self.proposal.blockhash)
            else:  # repeat vote
                self.log('voting on last vote')
                v = VoteBlock(self.height, self.round, last_lock.blockhash)
        elif self.timeout_time is not None and self.timeout_time >= self.cm.chainservice.now:
            if isinstance(last_lock, VoteBlock):  # repeat vote
                self.log('timeout voting on last vote')
                v = VoteBlock(self.height, self.round, last_lock.blockhash)
            else:
                self.log('timeout voting not locked')
                v = VoteNil(self.height, self.round)
        else:
            return
        self.cm.sign(v)

        self.log('voted', vote=v)
        self.lock = v
        assert self.hm.last_lock == self.lock
        self.lockset.add(v)
        return v
dataset/ETHPy150Open HydraChain/hydrachain/hydrachain/consensus/manager.py/RoundManager.vote/swapped operands of `>=`