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

get_full_account should return vesting_balance_object_with_info #626

Closed
xeroc opened this issue Mar 16, 2016 · 3 comments
Closed

get_full_account should return vesting_balance_object_with_info #626

xeroc opened this issue Mar 16, 2016 · 3 comments

Comments

@xeroc
Copy link
Contributor

xeroc commented Mar 16, 2016

get_full_account should return vesting_balance_object_with_info instead of
vesting_balance_object.

That would allow the wallet to easily show the vesting balances and withdraw-able amounts but would probably result in additional load at the witness node.

Is there an alternative way to let the witness derive the "allowed_withdraw" parameter of a vesting balance?

@theoreticalbts
Copy link
Contributor

Um, the get_allowed_withdraw() algorithm for each vesting policy is in vesting_balance_object.cpp. In principle, you can re-implement this algorithm in whatever's calling the witness node, but it requires uint128_t math, which might not be so easy in JS.

The other problem is that the derived fields of vesting_balance_with_info won't update. Being allowed to withdraw more because time has passed doesn't result in an object update, rather the time passed into get_allowed_withdraw() is different. This allows VBO's to vest continuously over time without burdening the chain too much. Moreover updating these fields when there's a deposit / withdrawal to/from the VBO would require special-casing in the subscription logic.

The real solution is, if you want to do fancy things with get_allowed_withdraw() in your UI, you want to simply re-implement the functionality at the UI level. If that's too hard, then you can always just call get_vesting_balances() which does return the VBO.

@abitmore
Copy link
Contributor

Just a note here, the rate limited free transaction feature (#603) has a similar function compute_coin_seconds_earned() which requires uint128_t math as well, so it's best if UI has a uint128_t implementation.

@vikramrajkumar
Copy link
Contributor

This issue was moved to bitshares/bitshares-core#195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants