add additional debug info to beacon node

Signed-off-by: Leo Chen <leo@harmony.one>
pull/175/head
Leo Chen 6 years ago
parent c7efda6d89
commit 7db51f0ab5
  1. 3
      beaconchain/libs/beaconchain.go

@ -92,7 +92,7 @@ func generateBCKey() kyber.Point {
//AcceptConnections welcomes new connections
func (bc *BeaconChain) AcceptConnections(b []byte) {
Node := bcconn.DeserializeNodeInfo(b)
bc.log.Info("Obtained node information, updating local information")
bc.log.Info("New Node Connection", "IP", Node.Self.IP, "Port", Node.Self.Port)
bc.NumberOfNodesAdded = bc.NumberOfNodesAdded + 1
_, isLeader := utils.AllocateShard(bc.NumberOfNodesAdded, bc.NumberOfShards)
if isLeader {
@ -101,6 +101,7 @@ func (bc *BeaconChain) AcceptConnections(b []byte) {
response := bcconn.ResponseRandomNumber{NumberOfShards: bc.NumberOfShards, NumberOfNodesAdded: bc.NumberOfNodesAdded, Leaders: bc.Leaders}
msg := bcconn.SerializeRandomInfo(response)
msgToSend := proto_identity.ConstructIdentityMessage(proto_identity.Acknowledge, msg)
bc.log.Info("Sent Out Msg", "# Nodes", response.NumberOfNodesAdded)
host.SendMessage(bc.host, Node.Self, msgToSend, nil)
}

Loading…
Cancel
Save