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

TryGetUnspentTxOutput() public method

public TryGetUnspentTxOutput ( TxOutputKey txOutputKey, TxOutput &txOutput ) : bool
txOutputKey TxOutputKey
txOutput TxOutput
return bool
        public bool TryGetUnspentTxOutput(TxOutputKey txOutputKey, out TxOutput txOutput)
        {
            CheckTransaction();

            using (SetSessionContext())
            {
                Api.JetSetCurrentIndex(this.jetSession, this.unspentTxOutputTableId, "IX_TxOutputKey");
                Api.MakeKey(this.jetSession, this.unspentTxOutputTableId, DbEncoder.EncodeTxOutputKey(txOutputKey), MakeKeyGrbit.NewKey);
                if (Api.TrySeek(this.jetSession, this.unspentTxOutputTableId, SeekGrbit.SeekEQ))
                {
                    var txOutputBytesColumn = new BytesColumnValue { Columnid = this.txOutputBytesColumnId };
                    Api.RetrieveColumns(this.jetSession, this.unspentTxOutputTableId, txOutputBytesColumn);

                    txOutput = DataDecoder.DecodeTxOutput(txOutputBytesColumn.Value);
                    return true;
                }

                txOutput = default(TxOutput);
                return false;
            }
        }