Esempio n. 1
0
        public MempoolBehavior(
            IMempoolValidator validator,
            MempoolManager mempoolManager,
            MempoolOrphans orphans,
            IConnectionManager connectionManager,
            IInitialBlockDownloadState initialBlockDownloadState,
            ISignals signals,
            ILoggerFactory loggerFactory,
            Network network)
        {
            this.validator                 = validator;
            this.mempoolManager            = mempoolManager;
            this.orphans                   = orphans;
            this.connectionManager         = connectionManager;
            this.initialBlockDownloadState = initialBlockDownloadState;
            this.signals                   = signals;
            this.logger        = loggerFactory.CreateLogger(GetType().FullName);
            this.loggerFactory = loggerFactory;
            this.network       = network;

            this.lockObject                = new object();
            this.inventoryTxToSend         = new HashSet <uint256>();
            this.filterInventoryKnown      = new HashSet <uint256>();
            this.isPeerWhitelistedForRelay = false;
            this.isBlocksOnlyMode          = false;
        }
Esempio n. 2
0
 /// <summary>
 ///     Constructs an instance of a MempoolSignaled object.
 ///     Starts the block notification loop to memory pool behaviors for connected nodes.
 /// </summary>
 /// <param name="manager">Memory pool manager injected dependency.</param>
 /// <param name="chainIndexer">Concurrent chain injected dependency.</param>
 /// <param name="connection">Connection manager injected dependency.</param>
 /// <param name="nodeLifetime">Node lifetime injected dependency.</param>
 /// <param name="asyncProvider">Asynchronous loop factory injected dependency.</param>
 /// <param name="mempoolLock">The mempool lock.</param>
 /// <param name="memPool">the mempool.</param>
 /// <param name="validator">The mempool validator.</param>
 /// <param name="mempoolOrphans">The mempool orphan list.</param>
 public MempoolSignaled(
     MempoolManager manager,
     ChainIndexer chainIndexer,
     IConnectionManager connection,
     INodeLifetime nodeLifetime,
     IAsyncProvider asyncProvider,
     MempoolSchedulerLock mempoolLock,
     ITxMempool memPool,
     IMempoolValidator validator,
     MempoolOrphans mempoolOrphans,
     ISignals signals)
 {
     this.manager        = manager;
     this.chainIndexer   = chainIndexer;
     this.connection     = connection;
     this.nodeLifetime   = nodeLifetime;
     this.asyncProvider  = asyncProvider;
     this.mempoolLock    = mempoolLock;
     this.memPool        = memPool;
     this.validator      = validator;
     this.mempoolOrphans = mempoolOrphans;
     this.signals        = signals;
 }