Esempio n. 1
0
        public IEnumerable <uint256> GetMatchedTransactions()
        {
            var        flags = new BitReader(this.Flags);
            MerkleNode root  = MerkleNode.GetRoot((int)this.TransactionCount);

            List <uint256> .Enumerator hashes = this.Hashes.GetEnumerator();
            return(GetMatchedTransactionsCore(root, flags, hashes, false));
        }
        public IEnumerable <uint256> GetMatchedTransactions()
        {
            BitReader  flags  = new BitReader(Flags);
            MerkleNode root   = MerkleNode.GetRoot((int)TransactionCount);
            var        hashes = Hashes.GetEnumerator();

            return(GetMatchedTransactionsCore(root, flags, hashes, false));
        }
Esempio n. 3
0
        public MerkleNode GetMerkleRoot()
        {
            MerkleNode node  = MerkleNode.GetRoot((int)this.TransactionCount);
            var        flags = new BitReader(this.Flags);

            List <uint256> .Enumerator hashes = this.Hashes.GetEnumerator();
            GetMatchedTransactionsCore(node, flags, hashes, true).AsEnumerable();
            return(node);
        }
        public MerkleNode GetMerkleRoot()
        {
            MerkleNode node   = MerkleNode.GetRoot((int)TransactionCount);
            BitReader  flags  = new BitReader(Flags);
            var        hashes = Hashes.GetEnumerator();

            GetMatchedTransactionsCore(node, flags, hashes, true).AsEnumerable();
            return(node);
        }
Esempio n. 5
0
        public PartialMerkleTree(uint256[] vTxid, bool[] vMatch)
        {
            if (vMatch.Length != vTxid.Length)
            {
                throw new ArgumentException("The size of the array of txid and matches is different");
            }
            this.TransactionCount = (uint)vTxid.Length;

            MerkleNode root  = MerkleNode.GetRoot(vTxid);
            var        flags = new BitWriter();

            MarkNodes(root, vMatch);
            BuildCore(root, flags);

            this.Flags = flags.ToBitArray();
        }
Esempio n. 6
0
 public MerkleNode GetMerkleRoot()
 {
     return(MerkleNode.GetRoot(Transactions.Select(t => t.GetHash())));
 }
Esempio n. 7
0
 public MerkleNode GetMerkleRoot()
 {
     return(MerkleNode.GetRoot(_graphs.Select(t => t.GetHash()).Prepend(_poaHeader.GetHash())));
 }