Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
0c4adece
Commit
0c4adece
authored
Nov 04, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly list caps
parent
f76f953f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
peer.go
peer.go
+2
-1
js_types.go
xeth/js_types.go
+4
-2
No files found.
peer.go
View file @
0c4adece
...
...
@@ -673,6 +673,7 @@ func (p *Peer) pushPeers() {
}
func
(
self
*
Peer
)
pushStatus
()
{
fmt
.
Println
(
"push status"
)
msg
:=
wire
.
NewMessage
(
wire
.
MsgStatusTy
,
[]
interface
{}{
uint32
(
ProtocolVersion
),
uint32
(
NetVersion
),
...
...
@@ -825,7 +826,7 @@ func (p *Peer) handleHandshake(msg *wire.Msg) {
p
.
pushStatus
()
}
capsStrs
=
append
(
capsStrs
,
cap
)
capsStrs
=
append
(
capsStrs
,
fmt
.
Sprintf
(
"%s/%d"
,
cap
,
ver
)
)
}
peerlogger
.
Infof
(
"Added peer (%s) %d / %d (%v)
\n
"
,
p
.
conn
.
RemoteAddr
(),
p
.
ethereum
.
Peers
()
.
Len
(),
p
.
ethereum
.
MaxPeers
,
capsStrs
)
...
...
xeth/js_types.go
View file @
0c4adece
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment