Closed RiskingTime closed 6 years ago
This issue is caused by the fact that when blockchain amounts are 0, as will happen when the amount is transferred out. Currently we have no way to test for re-deposits and allow transactions that have a 0 blockchain balance since they're assumed not to be completed.
We could use the "depositcomplete value to track differences between deposits as well as to flag an account as valid (can make investment transactions), even with a 0 blockchain balance.
There are two place where thus will be updated: on the "CHECK DEPOSIT" button on the main game UI and in the "DEPOSIT" (to investment) button on the Account page.
On the back end the changes will involve the rpc_updateInvestorInfo
function in the investment plugin and the RPC_checkAccountDeposit
function in the main game server code. During the Admin transfer we will want to update the database so that we can detect that the available balance is valid (i.e. don't check verified balance in database).
We should add a check for this flag on the UPDATE BANKROLL MULTIPLIER function too (just to update the account if necessary). Are there other places in the app that check the account deposit? These should be updated too.
The Account page UI should update itself whenever values have changes (e.g. new deposit detected, etc.)
I would estimate this task to take approximately 3 hours, including testing.
Also we will want to change the "deposit_complete" in the database to something more descriptive ("deposit_status"?)
Fix has been committed (https://github.com/CoinRoster/slotmachine/commit/f5ed1e681f908bdd5a4cc4fdaf31cf1d324ce684), pulled to dev server, and is available for immediate testing.
Note that BlockCypher sometimes returns negative values:
After some investigation, it seems that these are not common but sometimes occur when it is deemed that the recent transaction(s) are highly unlikely to end up in a block. This seems to be related to our use of very low fees in the Admin page but may cause issues elsewhere too. I've tried to head this off at the pass by manipulating some returned values if they're negative but we should keep an eye on this. This is also the most probable and direct cause for issues https://github.com/CoinRoster/slotmachine/issues/45 and https://github.com/CoinRoster/slotmachine/issues/1
I added numbers to the testing steps to make it easier to understand which step to refer to
I hit a bug at step 4, the game allowed me to make a deposit to the bankroll even though my deposit wasn't confirmed yet. See image
tested this with a second account and when the deposit is unconfirmed, it does not allow the user to deposit to the bankroll (which is what it is supposed to do)
tried a third account, and wasn't able to deposit to the bankroll with unconfirmed funds, it looks like just one account mnWkKfPdgFC4fCoXM5bvd37jzwJJnx4qqj had the negative balance issue as mentioned above, the other two accounts I tested worked fine, let's just make note of this, but not spend any time examining for the time being
made it to testing step 10, made a subsequent unconfirmed deposit, and was able to also deposit this to the bankroll (I was able to deposit my entire balance (confirmed + unconfirmed) to the bankroll. this bug is pretty low risk, we could close it up, but let's just leave it for now
btc deposit has been made and confirmed on the blockchain, but system displays a msg saying "deposit not yet confirmed". This is not related to transfers made using the admin page as both of my test users have the same issue (and only one of the user's btc has been transferred using the admin panel)