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;
}