private void SendKnownAddresses(BitcoinEndpoint endpoint)
 {
     List<NetAddr> addresses = new List<NetAddr>();
     List<NodeConnection> currentConnections = connectionCollection.GetConnections();
     foreach (NodeConnection connection in currentConnections)
     {
         //todo: filter loopback addresses
         NetAddr addr = new NetAddr(
             //todo: use last message date instead
             (uint) connection.Endpoint.PeerInfo.VersionMessage.Timestamp,
             connection.Endpoint.PeerInfo.VersionMessage.Services,
             endpoint.PeerInfo.IpEndpoint.Address,
             (ushort) endpoint.PeerInfo.IpEndpoint.Port);
         addresses.Add(addr);
     }
     AddrMessage addrMessage = new AddrMessage(addresses.Take(AddrMessage.MaxAddressesPerMessage).ToArray());
     endpoint.WriteMessage(addrMessage);
 }
 private void SaveReceivedAddresses(AddrMessage addrMessage)
 {
     foreach (NetAddr addr in addrMessage.AddressList)
     {
         //todo: check timestamp in address?
         //todo: prioritize connections to port 8333
         addressCollection.Add(new NodeAddress(addr.Address, addr.Port));
     }
 }