Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
NonceOur uint64 `json:"-"`
NonceRecv uint64 `json:"-"`
NonceCipher *xtea.Cipher `json:"-"`
+ Established time.Time
LastPing time.Time
LastSent time.Time
willSentCycle time.Time
}
func newPeer(addr *net.UDPAddr, id PeerId, nonce int, key *[KeySize]byte) *Peer {
+ now := time.Now()
peer := Peer{
Addr: addr,
- LastPing: time.Now(),
+ Established: now,
+ LastPing: now,
Id: id,
NonceOur: uint64(Noncediff + nonce),
NonceRecv: uint64(Noncediff + 0),