diff --git a/plugins/autopeering/types/peer/constants.go b/plugins/autopeering/types/peer/constants.go index 1abfe1077276d1af817476f31324fa1710515f9e..a29c567c246f2467a7620f5b1f87e079db24a21d 100644 --- a/plugins/autopeering/types/peer/constants.go +++ b/plugins/autopeering/types/peer/constants.go @@ -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 ) diff --git a/plugins/autopeering/types/peer/peer.go b/plugins/autopeering/types/peer/peer.go index 9bc8510cf4fc9bfe7f171392983b7735e9e340d5..1428ed80e675b4c8cb60ff63836cb476bb8ba929 100644 --- a/plugins/autopeering/types/peer/peer.go +++ b/plugins/autopeering/types/peer/peer.go @@ -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) {