Skip to content

Commit

Permalink
log remove order error
Browse files Browse the repository at this point in the history
  • Loading branch information
sangaman committed Jul 24, 2020
1 parent ab03e59 commit 0c60419
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/orderbook/OrderBook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ class OrderBook extends EventEmitter {
if (this.currencyInstances.has(currency.id)) {
throw errors.CURRENCY_ALREADY_EXISTS(currency.id);
}
if (currency.swapClient === SwapClientType.Raiden && !currency.tokenAddress) {
if ((currency.swapClient === SwapClientType.Raiden || currency.swapClient === SwapClientType.Connext)
&& !currency.tokenAddress) {
throw errors.CURRENCY_MISSING_ETHEREUM_CONTRACT_ADDRESS(currency.id);
}
const currencyInstance = await this.repository.addCurrency({ ...currency, decimalPlaces: currency.decimalPlaces || 8 });
Expand Down Expand Up @@ -968,8 +969,8 @@ class OrderBook extends EventEmitter {
try {
const removeResult = this.removePeerOrder(oi.id, oi.pairId, peerPubKey, oi.quantity);
this.emit('peerOrder.invalidation', removeResult.order);
} catch {
this.logger.error(`failed to remove order (${oi.id}) of peer ${peerPubKey} (${pubKeyToAlias(peerPubKey)})`);
} catch (err) {
this.logger.error(`failed to remove order (${oi.id}) of peer ${peerPubKey} (${pubKeyToAlias(peerPubKey)})`, err);
// TODO: Penalize peer
}
}
Expand Down

0 comments on commit 0c60419

Please sign in to comment.