Exemplo n.º 1
0
        /// <summary>
        /// Sets the receipt root based on all the receipts generated in smart contract execution inside this block.
        /// </summary>
        private void UpdateReceiptRoot(SmartContractBlockHeader scHeader)
        {
            List <uint256> leaves  = this.receipts.Select(x => x.GetHash()).ToList();
            bool           mutated = false; // TODO: Do we need this?

            scHeader.ReceiptRoot = BlockMerkleRootRule.ComputeMerkleRoot(leaves, out mutated);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the bloom filter for all logs that occurred in this block's execution.
        /// </summary>
        private void UpdateLogsBloom(SmartContractBlockHeader scHeader)
        {
            Bloom logsBloom = new Bloom();

            foreach (Receipt receipt in this.receipts)
            {
                logsBloom.Or(receipt.Bloom);
            }
            scHeader.LogsBloom = logsBloom;
        }