Skip to content

Commit

Permalink
removePeerPair to support non-existing pair
Browse files Browse the repository at this point in the history
  • Loading branch information
Le Premier Homme committed Nov 1, 2020
1 parent 84ccbf2 commit e52ba4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/orderbook/OrderBook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,11 @@ class OrderBook extends EventEmitter {
}

private removePeerPair = (peerPubKey: string, pairId: string) => {
const tp = this.getTradingPair(pairId);
const tp = this.tradingPairs.get(pairId);
if (!tp) {
return;
}

const orders = tp.removePeerOrders(peerPubKey);
orders.forEach((order) => {
this.emit('peerOrder.invalidation', order);
Expand Down

0 comments on commit e52ba4f

Please sign in to comment.