BitSharp.Esent.EsentChainStateCursor.TryGetBlockSpentTxes C# (CSharp) Method

TryGetBlockSpentTxes() public method

public TryGetBlockSpentTxes ( int blockIndex, BlockSpentTxes &spentTxes ) : bool
blockIndex int
spentTxes BlockSpentTxes
return bool
        public bool TryGetBlockSpentTxes(int blockIndex, out BlockSpentTxes spentTxes)
        {
            CheckTransaction();

            using (SetSessionContext())
            {
                Api.JetSetCurrentIndex(this.jetSession, this.spentTxTableId, "IX_SpentBlockIndex");

                Api.MakeKey(this.jetSession, this.spentTxTableId, blockIndex, MakeKeyGrbit.NewKey);

                if (Api.TrySeek(this.jetSession, this.spentTxTableId, SeekGrbit.SeekEQ))
                {
                    var spentTxesBytes = Api.RetrieveColumn(this.jetSession, this.spentTxTableId, this.spentDataColumnId);

                    spentTxes = DataDecoder.DecodeBlockSpentTxes(spentTxesBytes);
                    return true;
                }
                else
                {
                    spentTxes = null;
                    return false;
                }
            }
        }