예제 #1
0
        /// <summary>
        /// Creates a PeerGroup with the given parameters. The connectionDelayMillis parameter controls how long the
        /// PeerGroup will wait between attempts to connect to nodes or read from any added peer discovery sources.
        /// </summary>
        public PeerGroup(IBlockStore blockStore, NetworkParameters networkNetworkParams, BlockChain chain)
        {
            _blockStore        = blockStore;
            this.networkParams = networkNetworkParams;
            _chain             = chain;

            peerConnectionPool = new ThreadWorkerPool(MaxPeerConnections);

            _inactives       = new ConcurrentQueue <PeerAddress>();
            _peers           = new List <Peer>();
            _peerDiscoverers = new List <IPeerDiscovery>();
            peerGroupTimer   = new SingleEntryTimer(PeerGroupTimerCallback);
        }
예제 #2
0
        /// <summary>
        /// Creates a PeerGroup with the given parameters. The connectionDelayMillis parameter controls how long the
        /// PeerGroup will wait between attempts to connect to nodes or read from any added peer discovery sources.
        /// </summary>
        public PeerGroup(IBlockStore blockStore, NetworkParameters networkNetworkParams, BlockChain chain)
        {
            _blockStore = blockStore;
            this.networkParams = networkNetworkParams;
            _chain = chain;

            peerConnectionPool = new ThreadWorkerPool(MaxPeerConnections);

            _inactives = new ConcurrentQueue<PeerAddress>();
            _peers = new List<Peer>();
            _peerDiscoverers = new List<IPeerDiscovery>();
            peerGroupTimer = new SingleEntryTimer(PeerGroupTimerCallback);
        }