From 94e823cc91c4d0b9103f1086ede772f14e33a1ce Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 26 Apr 2018 23:40:29 -0400 Subject: [PATCH] p2p: NodeInfo.Channels is HexBytes --- p2p/node_info.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/p2p/node_info.go b/p2p/node_info.go index 930f9bfea..e46236188 100644 --- a/p2p/node_info.go +++ b/p2p/node_info.go @@ -3,6 +3,8 @@ package p2p import ( "fmt" "strings" + + cmn "github.com/tendermint/tmlibs/common" ) const ( @@ -10,6 +12,7 @@ const ( maxNumChannels = 16 // plenty of room for upgrades, for now ) +// Max size of the NodeInfo struct func MaxNodeInfoSize() int { return maxNodeInfoSize } @@ -21,10 +24,11 @@ type NodeInfo struct { ID ID `json:"id"` // authenticated identifier ListenAddr string `json:"listen_addr"` // accepting incoming - // Check compatibility - Network string `json:"network"` // network/chain ID - Version string `json:"version"` // major.minor.revision - Channels []byte `json:"channels"` // channels this node knows about + // Check compatibility. + // Channels are HexBytes so easier to read as JSON + Network string `json:"network"` // network/chain ID + Version string `json:"version"` // major.minor.revision + Channels cmn.HexBytes `json:"channels"` // channels this node knows about // Sanitize Moniker string `json:"moniker"` // arbitrary moniker