public void DeleteSingleTransaction(string transactionId) { var item = Get(transactionId); database.DeleteOrderIndex(transactionId); IndexOrderCache.Remove(transactionId); database.UpdateToKeyMap("orders_" + item.TradingPair, transactionId); }
public OrderIndexItem Get(string transactionId) { var cachedIndex = IndexOrderCache.Get(transactionId); if (cachedIndex != null) { return(cachedIndex); } var index = database.GetOrderIndex(transactionId); if (index != null) { IndexOrderCache.AddOrUpdate(index); } return(index); }
public void AddToIndex(TransactionOrderLimit record) { if (record == null) { return; } var orderIndex = new OrderIndexItem() { TransactionId = record.TransactionId, Owner = record.Owner, TradingPair = record.TradingPair, Side = record.Side, Amount = record.Amount, Price = record.Price }; database.SaveOrderIndex(orderIndex); IndexOrderCache.AddOrUpdate(orderIndex); database.AddToKeyMap("orders_" + record.TradingPair, record.TransactionId); database.AddToKeyMap("orders_expiry_" + record.ExpiryBlockIndex, record.TransactionId); }
public void DeleteIndex(TransactionOrderLimit record) { database.DeleteOrderIndex(record.TransactionId); database.DeleteKeyMap("orders_" + record.TradingPair); IndexOrderCache.Remove(record.TransactionId); }
private void UpdateIndex(OrderIndexItem orderIndex) { database.SaveOrderIndex(orderIndex); IndexOrderCache.AddOrUpdate(orderIndex); }