|
|
@ -39,17 +39,17 @@ func (consensus *Consensus) ProcessMessageLeader(message []byte) { |
|
|
|
log.Printf("[Leader] Received and processing message: %s\n", msgType) |
|
|
|
log.Printf("[Leader] Received and processing message: %s\n", msgType) |
|
|
|
switch msgType { |
|
|
|
switch msgType { |
|
|
|
case ANNOUNCE: |
|
|
|
case ANNOUNCE: |
|
|
|
log.Println("Unexpected message type: %s", msgType) |
|
|
|
log.Printf("Unexpected message type: %s", msgType) |
|
|
|
case COMMIT: |
|
|
|
case COMMIT: |
|
|
|
consensus.processCommitMessage(payload) |
|
|
|
consensus.processCommitMessage(payload) |
|
|
|
case CHALLENGE: |
|
|
|
case CHALLENGE: |
|
|
|
log.Println("Unexpected message type: %s", msgType) |
|
|
|
log.Printf("Unexpected message type: %s", msgType) |
|
|
|
case RESPONSE: |
|
|
|
case RESPONSE: |
|
|
|
consensus.processResponseMessage(payload) |
|
|
|
consensus.processResponseMessage(payload) |
|
|
|
case START_CONSENSUS: |
|
|
|
case START_CONSENSUS: |
|
|
|
consensus.processStartConsensusMessage(payload) |
|
|
|
consensus.processStartConsensusMessage(payload) |
|
|
|
default: |
|
|
|
default: |
|
|
|
log.Println("Unexpected message type: %s", msgType) |
|
|
|
log.Printf("Unexpected message type: %s", msgType) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|