From f48da4e1523565f491de88266d2046251f1df09d Mon Sep 17 00:00:00 2001 From: muscle_boy Date: Wed, 4 Jul 2018 16:55:09 +0800 Subject: [PATCH] the struct of node_info add json field (#1120) * the transaction output amout prohibit set zero * add network access control api * format import code style * refactor * code refactor * bug fix * the struct node_info add json field --- netsync/peer.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/netsync/peer.go b/netsync/peer.go index db7c4091..677676cf 100644 --- a/netsync/peer.go +++ b/netsync/peer.go @@ -43,10 +43,10 @@ type peer struct { // PeerInfo indicate peer information type PeerInfo struct { - Id string - RemoteAddr string - Height uint64 - delay uint32 + Id string `json:"id"` + RemoteAddr string `json:"remote_addr"` + Height uint64 `json:"height"` + Delay uint32 `json:"delay"` } func newPeer(height uint64, hash *bc.Hash, Peer *p2p.Peer) *peer { @@ -126,7 +126,7 @@ func (p *peer) GetPeerInfo() *PeerInfo { Id: p.id, RemoteAddr: p.swPeer.RemoteAddr, Height: p.height, - delay: 0, // TODO + Delay: 0, // TODO } } -- 2.11.0