Esempio n. 1
0
        public Blockchain(Wallet miningWallet, IWalletManager walletManager, IHashFactory transactionHashFactory, ISignatureFactory signatureFactory, IMiningFactory miningFactory, IBlockStorage storage)
        {
            SignatureFactory = signatureFactory;
            Verifier         = signatureFactory.GetSignatureVerifier();

            MiningFactory = miningFactory;

            TransactionHashFactory = transactionHashFactory;
            Digest = TransactionHashFactory.GetDigest();

            MiningWallet  = miningWallet;
            WalletManager = walletManager;

            pendingTransactions = new LinkedList <Transaction>();
            storedChain         = storage;

            foreach (Block block in storedChain)
            {
                WalletManager.AcceptTransactions(block.Transactions);
            }
        }