Skip to content

Corrected sp_to_rshares math#53

Merged
cyon1c merged 1 commit intosteemit:masterfrom
aaroncox:rshares_fix
Jan 26, 2018
Merged

Corrected sp_to_rshares math#53
cyon1c merged 1 commit intosteemit:masterfrom
aaroncox:rshares_fix

Conversation

@aaroncox
Copy link
Contributor

@aaroncox aaroncox commented Sep 18, 2017

I found I was getting incorrect results based on this method, so I dug into the code in steemit/steem, and discovered the math was being done improperly.

https://github.com/steemit/steem/blob/8cd5f688d75092298bcffaa48a543ed9b01447a6/libraries/chain/steem_evaluator.cpp#L1169-L1190

I believe this pull request contains what the math should be to derive proper rshares for a given amount of SP.

Copy link
Contributor

@cyon1c cyon1c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving.

Suggestion that we remove some magic numbers like (56060*24) and replace with global constants to provide more human readable code.

@cyon1c cyon1c merged commit 7c77625 into steemit:master Jan 26, 2018
Dont-Copy-That-Floppy pushed a commit to Dont-Copy-That-Floppy/steem-python that referenced this pull request Feb 23, 2025
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

Successfully merging this pull request may close these issues.

2 participants