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

DeleteBlockIndex() private method

private DeleteBlockIndex ( BitSharp.Esent.EsentBlockTxesCursor cursor, UInt256 blockHash ) : void
cursor BitSharp.Esent.EsentBlockTxesCursor
blockHash UInt256
return void
        private void DeleteBlockIndex(EsentBlockTxesCursor cursor, UInt256 blockHash)
        {
            Api.JetSetCurrentIndex(cursor.jetSession, cursor.blockIndexTableId, "IX_BlockHash");
            Api.MakeKey(cursor.jetSession, cursor.blockIndexTableId, DbEncoder.EncodeUInt256(blockHash), MakeKeyGrbit.NewKey);

            if (Api.TrySeek(cursor.jetSession, cursor.blockIndexTableId, SeekGrbit.SeekEQ))
                Api.JetDelete(cursor.jetSession, cursor.blockIndexTableId);
            else
                throw new InvalidOperationException();
        }
    }