/// <summary>
        /// Update the context's UTXO set.
        /// </summary>
        /// <param name="context">Context that contains variety of information regarding blocks validation and execution.</param>
        /// <param name="transaction">Transaction which outputs will be added to the context's <see cref="UnspentOutputSet"/> and which inputs will be removed from it.</param>
        protected void UpdateUTXOSet(RuleContext context, Transaction transaction)
        {
            ChainedHeader    index = context.ValidationContext.ChainedHeaderToValidate;
            UnspentOutputSet view  = (context as UtxoRuleContext).UnspentOutputSet;

            view.Update(transaction, index.Height);
        }
Exemple #2
0
        /// <summary>
        /// Update the context's UTXO set.
        /// </summary>
        /// <param name="context">Context that contains variety of information regarding blocks validation and execution.</param>
        /// <param name="transaction">Transaction which outputs will be added to the context's <see cref="UnspentOutputSet"/> and which inputs will be removed from it.</param>
        protected void UpdateUTXOSet(RuleContext context, Transaction transaction)
        {
            this.Logger.LogTrace("()");

            ChainedHeader    index = context.ValidationContext.ChainedHeader;
            UnspentOutputSet view  = (context as UtxoRuleContext).UnspentOutputSet;

            view.Update(transaction, index.Height);

            this.Logger.LogTrace("(-)");
        }
        /// <summary>
        /// Updates context's UTXO set.
        /// </summary>
        /// <param name="context">Context that contains variety of information regarding blocks validation and execution.</param>
        /// <param name="transaction">Transaction which outputs will be added to the context's <see cref="UnspentOutputSet"/> and which inputs will be removed from it.</param>
        protected virtual void UpdateCoinView(RuleContext context, Transaction transaction)
        {
            this.Logger.LogTrace("()");

            ChainedHeader    index = context.BlockValidationContext.ChainedHeader;
            UnspentOutputSet view  = context.Set;

            view.Update(transaction, index.Height);

            this.Logger.LogTrace("(-)");
        }