Use it in various places instead of the GetSatoshi method.
Details
- Reviewers
jasonbcox - Group Reviewers
Restricted Project - Commits
- rSTAGING8b468bf3073e: Add a SATOSHI constant representing an Amount of one satoshi.
rABC8b468bf3073e: Add a SATOSHI constant representing an Amount of one satoshi.
./test/functional/test_runner.py --extended
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- addsatoshi
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 2725 Build 3562: Bitcoin ABC Buildbot (legacy) Build 3561: arc lint + arc unit
Event Timeline
I don't understand the purpose of this diff. Can you clarify why you think replacing GetSatoshis() with a division makes sense? It appears more difficult to read to me (and maybe even more error prone?)
src/amount.h | ||
---|---|---|
31 | Does this comment still make sense? The return value is always satoshis, so I'm not sure what these non-monetary operations are. | |
32 | Why not use / SATOSHI here? | |
144 | :[ | |
145 | I would prefer BITCOIN, personally. Doesn't *really* matter though. |
src/amount.h | ||
---|---|---|
32 | Ah yes. |
Clarified why this change is necessary on Slack:
deadalnix [8:16 AM]
Using a division makes it clear that precision may be lost. Changing getsatoshi is a reciepe for disaster as one callsite missed will cause code to do weird stuff.
jasonbcox [8:21 AM]
I guess that's a fair point. division at each site also allows migrations to be done one step at a time