OSDN Git Service

the struct of node_info add json field (#1120)
authormuscle_boy <shenao.78@163.com>
Wed, 4 Jul 2018 08:55:09 +0000 (16:55 +0800)
committerPaladz <yzhu101@uottawa.ca>
Wed, 4 Jul 2018 08:55:09 +0000 (16:55 +0800)
* 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

index db7c409..677676c 100644 (file)
@@ -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
        }
 }