add additonal log message in node/node_handler

Signed-off-by: Leo Chen <leo@harmony.one>
pull/82/head
Leo Chen 6 years ago
parent b718020a36
commit b6c54e8f34
  1. 4
      node/node.go
  2. 6
      node/node_handler.go

@ -44,7 +44,7 @@ type Node struct {
ClientPeer *p2p.Peer // The peer for the benchmark tx generator client, used for leaders to return proof-of-accept ClientPeer *p2p.Peer // The peer for the benchmark tx generator client, used for leaders to return proof-of-accept
Client *client.Client // The presence of a client object means this node will also act as a client Client *client.Client // The presence of a client object means this node will also act as a client
IsWaiting bool IsWaiting bool
SelfPeer p2p.Peer // TODO(minhdoan): it could be duplicated with Self below whose is Alok work. SelfPeer p2p.Peer // TODO(minhdoan): it could be duplicated with Self below whose is Alok work.
IDCPeer p2p.Peer IDCPeer p2p.Peer
SyncNode bool // TODO(minhdoan): Remove it later. SyncNode bool // TODO(minhdoan): Remove it later.
chain *core.BlockChain // Account Model chain *core.BlockChain // Account Model
@ -86,7 +86,7 @@ func (node *Node) StartServer(port string) {
// Disable this temporarily. // Disable this temporarily.
// node.blockchain = syncing.StartBlockSyncing(node.Consensus.GetValidatorPeers()) // node.blockchain = syncing.StartBlockSyncing(node.Consensus.GetValidatorPeers())
} }
fmt.Println("going to start server") fmt.Println("going to start server on port:", port)
//node.log.Debug("Starting server", "node", node, "port", port) //node.log.Debug("Starting server", "node", node, "port", port)
node.listenOnPort(port) node.listenOnPort(port)
} }

@ -194,6 +194,8 @@ func (node *Node) NodeHandler(conn net.Conn) {
node.Client.TransactionMessageHandler(msgPayload) node.Client.TransactionMessageHandler(msgPayload)
} }
} }
default:
node.log.Error("Unknown", "MsgCateory:", msgCategory)
} }
} }
@ -455,7 +457,7 @@ func (node *Node) pingMessageHandler(msgPayload []byte) {
node.log.Error("Can't get Ping Message") node.log.Error("Can't get Ping Message")
return return
} }
node.log.Info("Ping: %v", ping) node.log.Info("Ping", "Msg", ping)
return return
} }
@ -465,6 +467,6 @@ func (node *Node) pongMessageHandler(msgPayload []byte) {
node.log.Error("Can't get Pong Message") node.log.Error("Can't get Pong Message")
return return
} }
node.log.Info("Pong: %v", pong) node.log.Info("Pong", "Msg", pong)
return return
} }

Loading…
Cancel
Save