func (op *obcSieve) viewChange(newView uint64) {
	logger.Info("Replica %d observing pbft view change to %d", op.id, newView)
	op.queuedTx = nil
	op.imminentEpoch = newView

	for idx := range op.pbft.outstandingReqs {
		delete(op.pbft.outstandingReqs, idx)
	}
	op.pbft.stopTimer()
	op.complainer.Restart()

	if op.pbft.primary(newView) == op.id {
		flush := &Flush{View: newView}
		flush.ReplicaId = op.id
		op.pbft.sign(flush)
		req := &SievePbftMessage{Payload: &SievePbftMessage_Flush{flush}}
		go op.invokePbft(req)
	}
}
// called by pbft-core to signal when a view change happened
called by pbft-core to signal when a view change happened
// called by pbft - core to signal when a view change happened
func (op *obcSieve) viewChange(newView uint64) {
	logger.Info("Replica %d observing pbft view change to %d", op.id, newView)
	op.queuedTx = nil
	op.imminentEpoch = newView
	for idx := range op.pbft.outstandingReqs {
		delete(op.pbft.outstandingReqs, idx)
	}
	op.pbft.stopTimer()
	op.complainer.Restart()
	if op.pbft.primary(newView) == op.id {
		flush := &Flush{View: newView}
		flush.ReplicaId = op.id
		op.pbft.sign(flush)
		req := &SievePbftMessage{Payload: &SievePbftMessage_Flush{flush}}
		go op.invokePbft(req)
	}
}
func ( op * obcSieve ) viewChange ( newView uint64 ) { logger . Info ( " " , op . id , newView ) op . queuedTx = nil op . imminentEpoch = newView for idx := range op . pbft . outstandingReqs { delete ( op . pbft . outstandingReqs , idx ) } op . pbft . stopTimer ( ) op . complainer . Restart ( ) if op . pbft . primary ( newView ) == op . id { flush := & Flush { View : newView } flush . ReplicaId = op . id op . pbft . sign ( flush ) req := & SievePbftMessage { Payload : & SievePbftMessage_Flush { flush } } go op . invokePbft ( req ) } }
called by pbft-core to signal when a view change happened
called by pbft - core to signal when a view change happened