|
|
@ -319,6 +319,7 @@ func New(host p2p.Host, consensus *bft.Consensus, db ethdb.Database) *Node { |
|
|
|
|
|
|
|
|
|
|
|
if consensus != nil && consensus.IsLeader { |
|
|
|
if consensus != nil && consensus.IsLeader { |
|
|
|
node.State = NodeLeader |
|
|
|
node.State = NodeLeader |
|
|
|
|
|
|
|
go node.ReceiveClientGroupMessage() |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
node.State = NodeInit |
|
|
|
node.State = NodeInit |
|
|
|
} |
|
|
|
} |
|
|
@ -333,11 +334,6 @@ func New(host p2p.Host, consensus *bft.Consensus, db ethdb.Database) *Node { |
|
|
|
// start the goroutine to receive group message
|
|
|
|
// start the goroutine to receive group message
|
|
|
|
go node.ReceiveGroupMessage() |
|
|
|
go node.ReceiveGroupMessage() |
|
|
|
|
|
|
|
|
|
|
|
// only start the goroutine for leader
|
|
|
|
|
|
|
|
if consensus.IsLeader { |
|
|
|
|
|
|
|
go node.ReceiveClientGroupMessage() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
node.duplicatedPing = make(map[string]bool) |
|
|
|
node.duplicatedPing = make(map[string]bool) |
|
|
|
|
|
|
|
|
|
|
|
if utils.UseLibP2P { |
|
|
|
if utils.UseLibP2P { |
|
|
|