Skip to content

Commit 693a01b

Browse files
committed
fix(pool): xud crashes upon receiving NodeStateUpdatePacket including an unexisting trading pair
1 parent adb8b14 commit 693a01b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/p2p/Pool.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,8 +827,10 @@ class Pool extends EventEmitter {
827827
});
828828

829829
peer.on('pairDropped', (pairId) => {
830-
// drop all orders for trading pairs that are no longer supported
831-
this.emit('peer.pairDropped', peer.nodePubKey!, pairId);
830+
// drop all orders for trading pairs that exist and are no longer supported
831+
if (this.nodeState.pairs.includes(pairId)) {
832+
this.emit('peer.pairDropped', peer.nodePubKey!, pairId);
833+
}
832834
});
833835

834836
peer.on('verifyPairs', () => {

0 commit comments

Comments
 (0)