Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Goshimmer_without_tipselection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COLLET Ismael
Goshimmer_without_tipselection
Commits
06f39953
Commit
06f39953
authored
5 years ago
by
Hans Moog
Browse files
Options
Downloads
Patches
Plain Diff
Feat: started adding timestamps to peers (to clean up offline nodes)
parent
51723c5d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/autopeering/types/peer/constants.go
+2
-1
2 additions, 1 deletion
plugins/autopeering/types/peer/constants.go
plugins/autopeering/types/peer/peer.go
+12
-7
12 additions, 7 deletions
plugins/autopeering/types/peer/peer.go
with
14 additions
and
8 deletions
plugins/autopeering/types/peer/constants.go
+
2
−
1
View file @
06f39953
...
...
@@ -26,5 +26,6 @@ const (
MARSHALED_PEERING_PORT_SIZE
=
2
MARSHALED_GOSSIP_PORT_SIZE
=
2
MARSHALED_SALT_SIZE
=
salt
.
SALT_MARSHALED_SIZE
MARSHALED_TOTAL_SIZE
=
MARSHALED_SALT_END
MARSHALED_TOTAL_SIZE
=
MARSHALED_SALT_END
)
This diff is collapsed.
Click to expand it.
plugins/autopeering/types/peer/peer.go
+
12
−
7
View file @
06f39953
...
...
@@ -5,6 +5,7 @@ import (
"net"
"strconv"
"sync"
"time"
"github.com/iotaledger/goshimmer/packages/events"
"github.com/iotaledger/goshimmer/packages/identity"
...
...
@@ -15,13 +16,17 @@ import (
)
type
Peer
struct
{
Identity
*
identity
.
Identity
Address
net
.
IP
PeeringPort
uint16
GossipPort
uint16
Salt
*
salt
.
Salt
Conn
*
network
.
ManagedConnection
connectMutex
sync
.
Mutex
Identity
*
identity
.
Identity
Address
net
.
IP
PeeringPort
uint16
GossipPort
uint16
Salt
*
salt
.
Salt
Conn
*
network
.
ManagedConnection
connectMutex
sync
.
Mutex
firstSeen
time
.
Time
firstSeenMutex
sync
.
RWMutex
lastSeen
time
.
Time
lastSeenMutex
sync
.
RWMutex
}
func
Unmarshal
(
data
[]
byte
)
(
*
Peer
,
error
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment