Skip to content

Commit

Permalink
Consensus case added
Browse files Browse the repository at this point in the history
Consensus case added
  • Loading branch information
btosys committed Jun 10, 2019
1 parent 734766d commit 225674b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion action/actor/net/netactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewNetActor(env *env.ActorEnv) *actor.PID {
pid, err := actor.SpawnNamed(props, "NetActor")
if err == nil {

netactor.protocol = netprotocol.MakeProtocol(&config.Param, env.Chain)
netactor.protocol = netprotocol.MakeProtocol(&config.BtoConfig.P2P, env.Chain)
netactor.protocol.Start()

env.Protocol = netactor.protocol
Expand Down Expand Up @@ -94,6 +94,15 @@ func (n *NetActor) handleSystemMsg(context actor.Context) {
case *message.NotifyBlock:
n.protocol.SendNewBlock(msg)

case *message.SendPrevote:
n.protocol.SendPrevote(msg)

case *message.SendPrecommit:
n.protocol.SendPrecommit(msg)

case *message.SendCommit:
n.protocol.SendCommit(msg)

default:
log.Error("netactor receive unknown message")
}
Expand Down
2 changes: 1 addition & 1 deletion p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type SendupCb func(index uint16, p *Packet)
type NewconnCb func(conn net.Conn)

//MakeP2PServer create instance
func MakeP2PServer(p *config.Parameter) *P2PServer {
func MakeP2PServer(p *config.P2PConfig) *P2PServer {
LocalPeerInfo.Addr = p.P2PServAddr
LocalPeerInfo.Port = strconv.Itoa(p.P2PPort)
LocalPeerInfo.ChainId = common.BytesToHex(config.GetChainID())
Expand Down

0 comments on commit 225674b

Please sign in to comment.