Пример #1
0
        private void startWalletStateSync()
        {
            HashSet <string> all_neighbors = new HashSet <string>(NetworkClientManager.getConnectedClients(true).Concat(NetworkServer.getConnectedClients(true)));

            if (all_neighbors.Count < 1)
            {
                Logging.info(String.Format("Wallet state synchronization from storage."));
                return;
            }

            Random r = new Random();

            syncNeighbor = all_neighbors.ElementAt(r.Next(all_neighbors.Count));
            Logging.info(String.Format("Starting wallet state synchronization from {0}", syncNeighbor));
            ProtocolMessage.syncWalletStateNeighbor(syncNeighbor);
        }