Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
5dea3845
Commit
5dea3845
authored
Sep 16, 2014
by
Juan Batiz-Benet
Committed by
Brian Tiger Chow
Sep 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
peer: golint
parent
71e411e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
peer/peer.go
peer/peer.go
+3
-0
No files found.
peer/peer.go
View file @
5dea3845
...
...
@@ -21,6 +21,7 @@ func (id ID) Equal(other ID) bool {
return
bytes
.
Equal
(
id
,
other
)
}
// Pretty returns a b58-encoded string of the ID
func
(
id
ID
)
Pretty
()
string
{
return
b58
.
Encode
(
id
)
}
...
...
@@ -73,6 +74,7 @@ func (p *Peer) NetAddress(n string) *ma.Multiaddr {
return
nil
}
// GetLatency retrieves the current latency measurement.
func
(
p
*
Peer
)
GetLatency
()
(
out
time
.
Duration
)
{
p
.
latenLock
.
RLock
()
out
=
p
.
latency
...
...
@@ -80,6 +82,7 @@ func (p *Peer) GetLatency() (out time.Duration) {
return
}
// SetLatency sets the latency measurement.
// TODO: Instead of just keeping a single number,
// keep a running average over the last hour or so
func
(
p
*
Peer
)
SetLatency
(
laten
time
.
Duration
)
{
...
...
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