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

Commit

Permalink
Fix issue #1664: Error 'Invalid end time.' on Poloniex (#1666)
Browse files Browse the repository at this point in the history
For some reason the opts.offset is void, so I patched the code to use the default value in these cases.
  • Loading branch information
cvinacua authored and DeviaVir committed Jul 19, 2018
1 parent e367ffd commit cc692c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/exchanges/poloniex/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ module.exports = function container (conf) {
}
if (args.start && !args.end) {
// add 12 hours
args.end = args.start + opts.offset
args.end = args.start + (opts.offset || this.offset)
}
else if (args.end && !args.start) {
// subtract 12 hours
args.start = args.end - opts.offset
args.start = args.end - (opts.offset || this.offset)
}

client._public('returnTradeHistory', args, function (err, body) {
Expand Down

0 comments on commit cc692c4

Please sign in to comment.