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: Pending transactions causing wallet to keep sending money out in 6.0.0 RC

dashed-slug.net Forums General discussion Pending transactions causing wallet to keep sending money out in 6.0.0 RC Reply To: Pending transactions causing wallet to keep sending money out in 6.0.0 RC

#12227
alexg
Keymaster

Oh no, this sounds rather serious. I’m sorry about that. I hope you only lost Litecoin testnet coins or a small amount of funds.

Normally the plugin has protections against this kind of thing.

Did you manage to gather logs? To do this, please enable logging in: Settings → Bitcoin and Altcoin Wallets → Cron tasks → Verbose logging. When a withdrawal next occurs, this is the log output that will tell us what happened.

I have a theory for why this happened, but I’m not sure without looking at logs: The plugin first checks for sufficient balance, then proceeds to withdraw. If you got a negative balance out of this, then that means multiple cron tasks ran concurrently. Normally the plugin guards against this with semaphores: https://github.com/dashed-slug/wallets/blob/6.0.0-RC4/cron/abstract-task.php#L204-L220

However the semaphores are implemented as transients. Depending on your cache settings, transients may be unreliable, and I may need to change them to options.

Can you please tell me the following:

1. Did the negative balance occur on the user who owns the withdrawal and for the currency of the withdrawal? Or is this an unrelated incident?

2. Do you have verbose logs from a withdrawal run (while there are still funds to withdraw)?

3. What server-side caching plugin do you use?

You can “fix” the negative balance for the user if you create a new “deposit” or “move” transaction for that user (Transactions → New). The transaction needs to be created in two steps. First create and save the transaction with the desired user and currency, then set the amount to add to the user’s balance, and save again. However this will not return the funds to your site, it will only amend the user’s balance.

Remember, this is an RC version and issues are to be expected. It’s not yet suitable for production. Thank you for reporting this.

P.S. I have moved your post in a new thread since it is unrelated to your previous query.