Skip to content

Commit

Permalink
fix: only drop rejected transfers from cache
Browse files Browse the repository at this point in the history
  • Loading branch information
cdummett committed May 16, 2024
1 parent 40ecff7 commit 7997517
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 0 additions & 3 deletions vega_sim/api/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2371,9 +2371,6 @@ def list_transfers(
for transfer_node in transfer_nodes:
transfer = transfer_node.transfer

if transfer.status == events_protos.Transfer.Status.STATUS_REJECTED:
continue

if transfer.asset not in asset_dp:
asset_dp[transfer.asset] = get_asset_decimals(
asset_id=transfer.asset, data_client=data_client
Expand Down
8 changes: 3 additions & 5 deletions vega_sim/local_data_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,12 @@ def initialise_market_data(
def initialise_transfer_monitoring(
self,
):
base_transfers = []

base_transfers.extend(
data.list_transfers(data_client=self._trading_data_client)
)
base_transfers = data.list_transfers(data_client=self._trading_data_client)

with self.transfers_lock:
for t in base_transfers:
if t.status != events_protos.Transfer.Status.STATUS_REJECTED:
continue
self._transfer_state_from_feed.setdefault(t.party_to, {})[t.id] = t

def initialise_network_parameters(self):
Expand Down

0 comments on commit 7997517

Please sign in to comment.