diff options
author | obscuren <geffobscura@gmail.com> | 2014-11-04 08:47:02 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-11-04 08:47:02 +0800 |
commit | 0c4adeceaeaff7a954fa7103a2200653ef217572 (patch) | |
tree | 8919f34b6fd356ca8d341d23d8cada83eb6d8a05 /xeth | |
parent | f76f953f0cad3b55d6817ce766def50a587f1d19 (diff) | |
download | go-tangerine-0c4adeceaeaff7a954fa7103a2200653ef217572.tar.gz go-tangerine-0c4adeceaeaff7a954fa7103a2200653ef217572.tar.zst go-tangerine-0c4adeceaeaff7a954fa7103a2200653ef217572.zip |
Properly list caps
Diffstat (limited to 'xeth')
-rw-r--r-- | xeth/js_types.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xeth/js_types.go b/xeth/js_types.go index 9f8f12e7f..1a1938648 100644 --- a/xeth/js_types.go +++ b/xeth/js_types.go @@ -176,10 +176,12 @@ func NewJSPeer(peer chain.Peer) *JSPeer { var caps []string capsIt := peer.Caps().NewIterator() for capsIt.Next() { - caps = append(caps, capsIt.Value().Str()) + cap := capsIt.Value().Get(0).Str() + ver := capsIt.Value().Get(1).Uint() + caps = append(caps, fmt.Sprintf("%s/%d", cap, ver)) } - return &JSPeer{ref: &peer, Inbound: peer.Inbound(), LastSend: peer.LastSend().Unix(), LastPong: peer.LastPong(), Version: peer.Version(), Ip: ipAddress, Port: int(peer.Port()), Latency: peer.PingTime(), Caps: fmt.Sprintf("%v", caps)} + return &JSPeer{ref: &peer, Inbound: peer.Inbound(), LastSend: peer.LastSend().Unix(), LastPong: peer.LastPong(), Version: peer.Version(), Ip: ipAddress, Port: int(peer.Port()), Latency: peer.PingTime(), Caps: "[" + strings.Join(caps, ", ") + "]"} } type JSReceipt struct { |