Ejemplo n.º 1
0
// Returns true if this is a message for this server to execute as
// a leader.
func (m *CommitEntryMsg) Leader(state interfaces.IState) bool {
	//TODO: implement properly
	return state.LeaderFor(nil)
	/*
		switch state.GetNetworkNumber() {
		case 0: // Main Network
			panic("Not implemented yet")
		case 1: // Test Network
			panic("Not implemented yet")
		case 2: // Local Network
			panic("Not implemented yet")
		default:
			panic("Not implemented yet")
		}*/

}
Ejemplo n.º 2
0
// Returns true if this is a message for this server to execute as
// a leader.
func (m *FactoidTransaction) Leader(state interfaces.IState) bool {
	return state.LeaderFor(constants.FACTOID_CHAINID)
}
Ejemplo n.º 3
0
// Returns true if this is a message for this server to execute as
// a leader.
func (m *RevealEntryMsg) Leader(state interfaces.IState) bool {
	return state.LeaderFor(m.Entry.GetHash().Bytes())
}
Ejemplo n.º 4
0
// Returns true if this is a message for this server to execute as
// a leader.
func (m *CommitChainMsg) Leader(state interfaces.IState) bool {
	return state.LeaderFor(constants.EC_CHAINID)
}