-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADDED] getrealbalance wrapper for payouts #1757
Conversation
During payouts, we must ensure our wallets main accounts has the funds
to payout users. Hence we implement a wrapper method:
* If account count == 1 we only have main account, return getbalance
* Else return our main accounts balance - calculated unconfirmed
This should keep getbalance untouched when used on other places but
gives our payout processing a proper main account balance.
It's mostly a wrapper for those wallets running multiple accounts in one
wallet. They are warned on the front-end already but this ensure payouts
process properly.
Fixes #1755 once merged.
using php abs() should do the trick with negative balance
Looks good. Please get it tested then merge. |
tested and looks good so far, can someone confirm this? |
Tested with multiple accounts, positive main account balance. Returned value was the expected one for a |
Moved out more than available coins from the main account. Updated the bitcoinwrapper since you missed a Now it should be okay? |
yeah, forgot that. was copy and paste from ipad directly to your pr, no push :) sure, if main account is negative there's no need to do further checks. payout should be stopped because of insufficient funds. so i think we can merge if no one complains. but we can delete the if case, effect is the same, balance is negative. |
True but balance had a wrong negative value. I prefer to bail with the actual main accounts negative value instead of a strange one. We merge in a few hours unless we hear a veto. |
no veto from here :) |
[ADDED] getrealbalance wrapper for payouts
During payouts, we must ensure our wallets main accounts has the funds
to payout users. Hence we implement a wrapper method:
This should keep getbalance untouched when used on other places but
gives our payout processing a proper main account balance.
It's mostly a wrapper for those wallets running multiple accounts in one
wallet. They are warned on the front-end already but this ensure payouts
process properly.
Fixes #1755 once merged.