Skip to content

Commit

Permalink
state: caching: order-cache: Build new filter-based cache interface (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
joeykraut authored Dec 21, 2024
1 parent f96d3e9 commit 4175bef
Show file tree
Hide file tree
Showing 5 changed files with 232 additions and 191 deletions.
3 changes: 2 additions & 1 deletion state/src/applicator/order_book.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ impl StateApplicator {
tx.commit()?;

// Mark the order as locally matchable in the order book cache
self.order_cache().add_matchable_order_blocking(order_id);
todo!("re-implement write paths for order book cache");
// self.order_cache().add_matchable_order_blocking(order_id);
self.system_bus().publish(
ORDER_STATE_CHANGE_TOPIC.to_string(),
SystemBusMessage::OrderStateChange { order: order_info },
Expand Down
4 changes: 2 additions & 2 deletions state/src/applicator/wallet_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ impl StateApplicator {
/// that are
fn update_external_order_cache(&self, wallet: &Wallet) {
let order_cache = self.order_cache();
for (id, order) in wallet.get_nonzero_orders().into_iter() {
for (id, order) in wallet.get_matchable_orders().into_iter() {
if order.allow_external_matches {
order_cache.add_externally_enabled_order_blocking(id);
order_cache.mark_order_externally_matchable_blocking(id);
} else {
order_cache.remove_externally_enabled_order_blocking(id);
}
Expand Down
Loading

0 comments on commit 4175bef

Please sign in to comment.