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

AddTransaction() private method

private AddTransaction ( int blockIndex, int txIndex, UInt256 txHash, byte txBytes, BitSharp.Esent.EsentBlockTxesCursor cursor ) : void
blockIndex int
txIndex int
txHash UInt256
txBytes byte
cursor BitSharp.Esent.EsentBlockTxesCursor
return void
        private void AddTransaction(int blockIndex, int txIndex, UInt256 txHash, byte[] txBytes, EsentBlockTxesCursor cursor)
        {
            using (var jetUpdate = cursor.jetSession.BeginUpdate(cursor.blocksTableId, JET_prep.Insert))
            {
                Api.SetColumns(cursor.jetSession, cursor.blocksTableId,
                    new Int32ColumnValue { Columnid = cursor.blockIndexColumnId, Value = blockIndex },
                    new Int32ColumnValue { Columnid = cursor.txIndexColumnId, Value = txIndex },
                    //TODO i'm using -1 depth to mean not pruned, this should be interpreted as depth 0
                    new Int32ColumnValue { Columnid = cursor.blockDepthColumnId, Value = -1 },
                    new BytesColumnValue { Columnid = cursor.blockTxHashColumnId, Value = DbEncoder.EncodeUInt256(txHash) },
                    new BytesColumnValue { Columnid = cursor.blockTxBytesColumnId, Value = txBytes });

                jetUpdate.Save();
            }
        }