From 437855c17ba91ab143021015dcb09d7b2e3e9290 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Mon, 29 Jan 2018 11:29:37 +0100 Subject: [PATCH] fix(bitfinex): order not found (#1237) --- extensions/exchanges/bitfinex/exchange.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/exchanges/bitfinex/exchange.js b/extensions/exchanges/bitfinex/exchange.js index 41281c2f29..51efe042f1 100644 --- a/extensions/exchanges/bitfinex/exchange.js +++ b/extensions/exchanges/bitfinex/exchange.js @@ -489,6 +489,10 @@ module.exports = function container (get, set, clear) { getOrder: function (opts, cb) { var order = ws_orders['~' + opts.order_id] + if(!order) { + return cb(new Error('order id ' + opts.order_id + ' not found')) + } + if (order.status === 'rejected' && order.reject_reason === 'post only') { return cb(null, order) } else if (order.status === 'rejected' && order.reject_reason === 'zenbot canceled') {