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
a45e2932
Commit
a45e2932
authored
Sep 26, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/0.6.7' into develop
parents
68119d09
b8354124
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
state_manager.go
ethchain/state_manager.go
+1
-0
js_types.go
ethpipe/js_types.go
+9
-1
peer.go
peer.go
+4
-0
No files found.
ethchain/state_manager.go
View file @
a45e2932
...
...
@@ -32,6 +32,7 @@ type Peer interface {
Version
()
string
PingTime
()
string
Connected
()
*
int32
Caps
()
*
ethutil
.
Value
}
type
EthManager
interface
{
...
...
ethpipe/js_types.go
View file @
a45e2932
package
ethpipe
import
(
"fmt"
"strconv"
"strings"
...
...
@@ -151,6 +152,7 @@ type JSPeer struct {
Version
string
`json:"version"`
LastResponse
string
`json:"lastResponse"`
Latency
string
`json:"latency"`
Caps
string
`json:"caps"`
}
func
NewJSPeer
(
peer
ethchain
.
Peer
)
*
JSPeer
{
...
...
@@ -164,7 +166,13 @@ func NewJSPeer(peer ethchain.Peer) *JSPeer {
}
ipAddress
:=
strings
.
Join
(
ip
,
"."
)
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
()}
var
caps
[]
string
capsIt
:=
peer
.
Caps
()
.
NewIterator
()
for
capsIt
.
Next
()
{
caps
=
append
(
caps
,
capsIt
.
Value
()
.
Str
())
}
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
)}
}
type
JSReceipt
struct
{
...
...
peer.go
View file @
a45e2932
...
...
@@ -813,6 +813,10 @@ func (self *Peer) IsCap(cap string) bool {
return
false
}
func
(
self
*
Peer
)
Caps
()
*
ethutil
.
Value
{
return
self
.
protocolCaps
}
func
(
p
*
Peer
)
String
()
string
{
var
strBoundType
string
if
p
.
inbound
{
...
...
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