I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Reply To: Available balance calculations out of whack

dashed-slug.net Forums Exchange extension support Available balance calculations out of whack Reply To: Available balance calculations out of whack


Hello Megan,

(I would have liked to reply to you sooner but I spent all day assisting people who faced memory issues with the latest update, causing the cron jobs to not run in some cases. Version 4.0.1 solves most of these issues but in certain server configurations with multiple external wallets there can be problems. Fortunately there is now a way to debug these issues. I noticed that you have enabled a few coins yourslef, so if you detect any such problems, let me know.)

As for your issue with the exchange, the error is mine. I have made a mistake that I will correct in the next patch. I am a bit surprised that I never saw any error message, but somehow this went undetected.

Perhaps you could apply the fix to your code directly, and tell me if this is enough to solve the problem you encountered:

In file includes/php-api.php, line 1357, it now reads:

SUM( amount - filled ) * rate AS a

This is obviously a mistake that can cause a MySQL error 1140, and can therefore cause the available balance calculation to be wrong.

The correct expression would be:

SUM( ( amount - filled ) * rate ) AS a

If you can, please edit your code and see if the problem is resolved.

As always I appreciate very much your help in spotting this.

with regards