Uncomment consensus code.
@@ -2,6 +2,7 @@ package consensus
import (
"bytes"
+ "fmt"
"log"
"sync"
"time"
@@ -524,7 +525,6 @@ func (cs *consensus) enterNewHeight() {
}
func (cs *consensus) sendProposal(blockParts PartSet, polRound int32) error {
- /*
msg := newProposalMessage()
msg.Height = cs.height
msg.Round = cs.round
@@ -538,6 +538,7 @@ func (cs *consensus) sendProposal(blockParts PartSet, polRound int32) error {
if err != nil {
return errors.Errorf("sendVote : %v", err)
}
+ fmt.Printf("send message = %v \n", msg)
cs.dm.Broadcast(protoProposal, msgBS, module.BROADCAST_ALL)
bpmsg := newBlockPartMessage()
@@ -549,15 +550,14 @@ func (cs *consensus) sendProposal(blockParts PartSet, polRound int32) error {
if err != nil {
return errors.Errorf("sendVote : %v", err)
}
+ fmt.Printf("send message = %v \n", bpmsg)
cs.dm.Broadcast(protoBlockPart, bpmsgBS, module.BROADCAST_ALL)
}
- */
return nil
}
func (cs *consensus) sendVote(vt voteType, partSetID *PartSetID) error {
- /*
msg := newVoteMessage()
msg.Height = cs.height
msg.Round = cs.round
@@ -567,12 +567,12 @@ func (cs *consensus) sendVote(vt voteType, partSetID *PartSetID) error {
if err != nil {
return errors.Errorf("sendVote : %v", err)
}
- _, err = msgCodec.MarshalToBytes(msg)
+ msgBS, err := msgCodec.MarshalToBytes(msg)
if err != nil {
return errors.Errorf("sendVote : %v", err)
}
- */
- //cs.dm.Broadcast(protoVote, msgBS, module.BROADCAST_ALL)
+ fmt.Printf("send message = %v \n", msg)
+ cs.dm.Broadcast(protoVote, msgBS, module.BROADCAST_ALL)
return nil
}
