Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

[GB] recheck the order after cancel fail, fix #2440 #2441

Merged
merged 1 commit into from
Aug 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion exchange/wrappers/coinfalcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,22 @@ Trader.prototype.cancelOrder = function(order, callback) {
const handle = this.processResponse(this.cancelOrder, args, (err, res) => {
if(err) {
if(err.message.includes('has wrong status.')) {
return callback(undefined, true);

// see https://github.com/askmike/gekko/issues/2440
console.log('CANCELFIX', order, 'order has wrong status...');
return this.checkOrder(order, (err, res) => {
console.log('CANCELFIX', order, 'checked it:', res);

if(err) {
return callback(err);
}

if(!res.open) {
return callback(undefined, true);
}

return this.cancelOrder(order, callback);
});
}
return callback(err);
}
Expand Down