BitSharp.Esent.EsentBlockTxesStorage.AddBlockIndex C# (CSharp) Method

AddBlockIndex() private method

private AddBlockIndex ( BitSharp.Esent.EsentBlockTxesCursor cursor, UInt256 blockHash ) : int
cursor BitSharp.Esent.EsentBlockTxesCursor
blockHash UInt256
return int
        private int AddBlockIndex(EsentBlockTxesCursor cursor, UInt256 blockHash)
        {
            int blockIndex;
            using (var jetUpdate = cursor.jetSession.BeginUpdate(cursor.blockIndexTableId, JET_prep.Insert))
            {
                Api.SetColumn(cursor.jetSession, cursor.blockIndexTableId, cursor.blockIndexBlockHashColumnId, DbEncoder.EncodeUInt256(blockHash));
                blockIndex = Api.RetrieveColumnAsInt32(cursor.jetSession, cursor.blockIndexTableId, cursor.blockIndexBlockIndexColumnId, RetrieveColumnGrbit.RetrieveCopy).Value;

                jetUpdate.Save();
            }

            return blockIndex;
        }