diff --git a/lib/orderbook/OrderBook.ts b/lib/orderbook/OrderBook.ts index 98c29505c..a9c663326 100644 --- a/lib/orderbook/OrderBook.ts +++ b/lib/orderbook/OrderBook.ts @@ -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);