CAmount is currently not type-safe. Exporting a constant (CENT) that is commonly not referred to by that name might be confusing. CENT is only used in two places prior to this commit (ParseMoney and MIN_CHANGE). So replace these with constants relative to COIN and move CENT to the unit test header.
amount: Move CAmount CENT to unit test header #14244
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1809-amountNoCENT changing 5 files +12 −11-
MarcoFalke commented at 6:46 PM on September 17, 2018: member
-
amount: Move CAmount CENT to unit test header fa84723e73
- MarcoFalke added the label Refactoring on Sep 17, 2018
-
DrahtBot commented at 10:29 PM on September 17, 2018: member
<!--e57a25ab6845829454e8d69fc972939a-->Reviewers, this pull request conflicts with the following ones:
- #14156 ([WIP] refactor: Make explicit CMutableTransaction -> CTransaction conversion. by lucash-dev)
- #13470 (WIP [bench] CCoinsView(Cache): measure various scenarios by Sjors)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
-
laanwj commented at 7:35 PM on September 18, 2018: member
Concept ACK, getting rid of CENT is something I've been want to do for a while, no one uses the word 'cent' for bitcoins
-
Empact commented at 4:09 AM on September 19, 2018: member
utACK fa84723
-
in src/test/test_bitcoin.h:40 in fa84723e73
36 | @@ -37,6 +37,8 @@ static inline uint64_t InsecureRandBits(int bits) { return insecure_rand_ctx.ran 37 | static inline uint64_t InsecureRandRange(uint64_t range) { return insecure_rand_ctx.randrange(range); } 38 | static inline bool InsecureRandBool() { return insecure_rand_ctx.randbool(); } 39 | 40 | +static constexpr CAmount CENT{1000000};
promag commented at 9:23 PM on September 26, 2018:nit, could be
CENT{COIN / 100}?promag commented at 9:23 PM on September 26, 2018: memberutACK fa84723.
ryanofsky commented at 3:37 PM on September 27, 2018: memberutACK fa84723e73d3d7766e7821881ac96ec203e50efc
MarcoFalke merged this on Sep 27, 2018MarcoFalke closed this on Sep 27, 2018MarcoFalke deleted the branch on Sep 27, 2018deadalnix referenced this in commit 58be0d7ee9 on Mar 17, 2020ftrader referenced this in commit fde461960e on May 19, 2020kittywhiskers referenced this in commit f82a829a6c on Jun 4, 2021kittywhiskers referenced this in commit 6a2a137e71 on Jun 5, 2021kittywhiskers referenced this in commit 11ac41b265 on Jun 16, 2021kittywhiskers referenced this in commit 0a1fbc8320 on Jun 24, 2021kittywhiskers referenced this in commit f02b4a283d on Jun 25, 2021kittywhiskers referenced this in commit 884808cedf on Jun 25, 2021kittywhiskers referenced this in commit b53b395886 on Jun 26, 2021kittywhiskers referenced this in commit 60bcca3737 on Jun 27, 2021PastaPastaPasta referenced this in commit 75033d21f6 on Jun 27, 2021PastaPastaPasta referenced this in commit d1a6c29a6e on Jun 28, 2021kittywhiskers referenced this in commit 7cd58cc063 on Jun 28, 2021PastaPastaPasta referenced this in commit e2f838f757 on Jun 29, 2021PastaPastaPasta referenced this in commit e24fff7967 on Jul 1, 2021kittywhiskers referenced this in commit 49fbe647f7 on Jul 2, 2021DrahtBot locked this on Sep 8, 2021Labels
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me