Skip to content
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

[FIX] return balance from main account #1770

Merged
merged 5 commits into from
Feb 19, 2014
Merged

[FIX] return balance from main account #1770

merged 5 commits into from
Feb 19, 2014

Conversation

iAmShorty
Copy link
Contributor

return only the balance from main account.

calculation confuses users

2014-02-16 16:22:02 - ERROR -->  Wallet does not cover AP payouts - Payout: 1064.95853252 - Balance: -40,000

tested with 2 accounts in wallet, default account has funds of 40,000 and second account has 80,000. so there are liquid funds of 40,000 coins, but substracting 80,000 from main account makes the balance negative and payouts fail. better to return only the balance from default account without substracting the funds from other accounts. doesn't matter if there are funds in other accounts, when liquid funds in default account are enough to payout users.

@TheSerapher
Copy link
Contributor

We can't - this will include unconfirmed balance again and break the payout later down the road if we try to with unmatured coins.

@iAmShorty
Copy link
Contributor Author

ahhh, right, forgot that. will try to cover that and push a new one

@iAmShorty
Copy link
Contributor Author

maybe like this? will do further tests and research, but i think that's the only real solution to check the unconfirmed blocks before doing payouts and without falling into negative balance if funds from other accounts in wallet are higher than funds in default account.

@TheSerapher
Copy link
Contributor

dBalance on wallet info page may already be total without unconfirmed, you remove the unconfirmed then and will probably reduce the amount a fair bit depending in the total unconfirmed amount.

Not sure but doesn't look clean either :-/ we shall chat tomorrow, maybe it just needs proper documentation.

looks good while doing payouts
```
2014-02-16 17:51:09 - INFO --> Starting Payout...
2014-02-16 17:51:09 - INFO --> Auto Payout Sum: 107.55535194 - Wallet Balance: 35779.26412985 with 4750.003 unconfirmed
2014-02-16 17:51:09 - INFO -->   found 1 queued auto payouts
2014-02-16 17:51:09 - INFO -->     | UserID     | Username                  | Balance              | Address                                  | Threshold            |
2014-02-16 17:51:09 - INFO -->     | 5          | shorty                    | 107.55535194         | MMRFkUnQSMDBQSMBG3QBBaEg4ixSa7ksDm       | 100                  |
2014-02-16 17:51:11 - INFO -->   payout succeeded with RPC TXID: 722fbd25bd02e08516cb49577c0a69f8aa51be6a6867047cb553b29085c238d3
```
@iAmShorty
Copy link
Contributor Author

wallet balance is with unconfirmed funds.
bildschirmfoto 2014-02-16 um 17 53 50

funds in default account looks like this
bildschirmfoto 2014-02-16 um 17 54 08

and funds in second account like this
bildschirmfoto 2014-02-16 um 17 54 15

so i think substracting the unconfirmed from balance should be the real liquid assets? i agree, we should chat tomorrow, discussing this. will test over night and can report tomorrow.

@iAmShorty
Copy link
Contributor Author

looks good

2014-02-16 18:14:13 - INFO --> Starting Payout...
2014-02-16 18:14:13 - INFO --> Auto Payout Sum: 88.78070228 | Liquid Assets: 35736.58694457 | Wallet Balance: 40486.59094457 | Unconfirmed: 4750.004
2014-02-16 18:14:13 - INFO -->   found 2 queued auto payouts
2014-02-16 18:14:13 - INFO -->     | UserID     | Username                  | Balance              | Address                                  | Threshold            |
2014-02-16 18:14:13 - INFO -->     | 5          | shorty                    | 34.55789474          | MMRFkUnQSMDBQSMBG3QBBaEg4ixSa7ksDm       | 10                   |
2014-02-16 18:14:14 - INFO -->     | 12         | anonymous                 | 54.22280754          |  MQW9zmPeaaBSgTRyKAyq9mzd1jsrvaAWex      | 50                   |
2014-02-16 18:14:14 - INFO -->   payout succeeded with RPC TXID: d729fbf1bd5a70664a4c6356d641af74b79b2425301a69fb694883afad8b45d8

@TheSerapher
Copy link
Contributor

Sick today but maybe on - depends how I feel later.

@iAmShorty
Copy link
Contributor Author

no problem, get well soon...

TheSerapher added a commit that referenced this pull request Feb 19, 2014
[FIX] return balance from main account
@TheSerapher TheSerapher merged commit 8cb42aa into MPOS:next Feb 19, 2014
@TheSerapher
Copy link
Contributor

Thanks @iAmShorty , I also see no other way than doing some block/account magic.

@iAmShorty iAmShorty deleted the realbalance-wrapper branch February 19, 2014 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants