diff --git a/lib/swaps/Swaps.ts b/lib/swaps/Swaps.ts index 2d1e8f27e..94e290628 100644 --- a/lib/swaps/Swaps.ts +++ b/lib/swaps/Swaps.ts @@ -13,7 +13,7 @@ import { SwapDeal, SwapSuccess, SanitySwap, ResolveRequest, Route } from './type import { generatePreimageAndHash, setTimeoutPromise } from '../utils/utils'; import { PacketType } from '../p2p/packets'; import SwapClientManager from './SwapClientManager'; -import { errors } from './errors'; +import { errors, errorCodes } from './errors'; export type OrderToAccept = Pick & { quantity: number; @@ -697,7 +697,7 @@ class Swaps extends EventEmitter { try { await makerSwapClient.sendPayment(deal); } catch (err) { - if (err.code === errors.PAYMENT_REJECTED) { + if (err.code === errorCodes.PAYMENT_REJECTED) { // if the maker rejected our payment, the swap failed due to an error on their side // and we don't need to send them a SwapFailedPacket this.failDeal(deal, SwapFailureReason.RemoteError, err.message);