func (op *obcSieve) recvMsg(ocMsg *pb.Message, senderHandle *pb.PeerID) error {
	if ocMsg.Type == pb.Message_CHAIN_TRANSACTION {
		return op.request(ocMsg.Payload)
	}

	if ocMsg.Type == pb.Message_CONSENSUS {
		senderID, err := getValidatorID(senderHandle)
		if err != nil {
			panic("Cannot map sender's PeerID to a valid replica ID")
		}

		svMsg := &SieveMessage{}
		err = proto.Unmarshal(ocMsg.Payload, svMsg)
		if err != nil {
			err = fmt.Errorf("Could not unmarshal sieve message: %v", ocMsg)
			logger.Error(err.Error())
			return err
		}

		return op.receive(svMsg, senderID)
	}

	return fmt.Errorf("Unexpected message type: %s", ocMsg.Type)
}
// recvMsg is the internal handler for messages which come in through RecvMsg
recvMsg is the internal handler for messages which come in through RecvMsg
// recvMsg is the internal handler for messages which come in through RecvMsg
func (op *obcSieve) recvMsg(ocMsg *pb.Message, senderHandle *pb.PeerID) error {
	if ocMsg.Type == pb.Message_CHAIN_TRANSACTION {
		return op.request(ocMsg.Payload)
	}
	if ocMsg.Type == pb.Message_CONSENSUS {
		senderID, err := getValidatorID(senderHandle)
		if err != nil {
			panic("Cannot map sender's PeerID to a valid replica ID")
		}
		svMsg := &SieveMessage{}
		err = proto.Unmarshal(ocMsg.Payload, svMsg)
		if err != nil {
			err = fmt.Errorf("Could not unmarshal sieve message: %v", ocMsg)
			logger.Error(err.Error())
			return err
		}
		return op.receive(svMsg, senderID)
	}
	return fmt.Errorf("Unexpected message type: %s", ocMsg.Type)
}
func ( op * obcSieve ) recvMsg ( ocMsg * pb . Message , senderHandle * pb . PeerID ) error { if ocMsg . Type == pb . Message_CHAIN_TRANSACTION { return op . request ( ocMsg . Payload ) } if ocMsg . Type == pb . Message_CONSENSUS { senderID , err := getValidatorID ( senderHandle ) if err != nil { panic ( " " ) } svMsg := & SieveMessage { } err = proto . Unmarshal ( ocMsg . Payload , svMsg ) if err != nil { err = fmt . Errorf ( " " , ocMsg ) logger . Error ( err . Error ( ) ) return err } return op . receive ( svMsg , senderID ) } return fmt . Errorf ( " " , ocMsg . Type ) }
recvMsg is the internal handler for messages which come in through RecvMsg
recvMsg is the internal handler for messages which come in through RecvMsg