コード例 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public TxFlood() : base()
        {
            _rand = new Random();

            // This is used for relay directly without enter in our mempool

            _sendDirectlyType = typeof(LocalNode).GetMembers(BindingFlags.NonPublic)
                                .Where(u => u.Name == "SendDirectly")
                                .Cast <Type>()
                                .FirstOrDefault();

            _sendDirectlyField = _sendDirectlyType.GetFields(BindingFlags.Public | BindingFlags.Instance)
                                 .Where(u => u.Name == "Inventory")
                                 .FirstOrDefault();

            // Open wallet

            Wallet = WalletHelper.OpenWallet(WALLET_FILE, WALLET_PASS);

            _sources      = Wallet.GetAccounts().Skip(1).ToArray();
            _destinations = _sources.Skip(1).Concat(_sources.Take(1)).ToArray();

            // Warm up

            Parallel.ForEach(_sources, (a) => a.GetKey());
        }