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

consensus: move amount.h into consensus #22951

Merged
merged 3 commits into from
Oct 5, 2021

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Sep 11, 2021

A first step (of a few) towards some source code reorganization, as well as making libbitcoinconsensus slightly more self contained.

Related to #15732.

@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 11, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

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
Copy link
Member

laanwj commented Sep 14, 2021

Concept ACK. I think this is organizationally the right thing to do. Nearly everything in amount.h is consensus critical:

  • type CAmount
  • constant MAX_MONEY
  • function MoneyRange

Even COIN, though it strictly is a presentation detail, is used in src/validation.cpp to set the initial subsidy. So changing it would be consensus critical.

@hebasto
Copy link
Member

hebasto commented Sep 25, 2021

Concept ACK.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

ACK 2c1554a.

I see the last two commits as a way to modernize amount.h. Here are some additional suggestions:

@practicalswift
Copy link
Contributor

Concept ACK

@DrahtBot DrahtBot mentioned this pull request Oct 2, 2021
18 tasks
@maflcko
Copy link
Member

maflcko commented Oct 5, 2021

concept ACK 9d0379c 🏝

Show signature and timestamp

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

concept ACK 9d0379cea6c164610d05287ae6dd4e66f35b92b 🏝
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUiIegv/UQSjhE3MlZkZ8Q9eV6M5sxc+xLMthzRmDDxQrktiXjsquDzCTLaKGrlA
26ASYaHNdvfTPn3UMY8IU2ibgI5EwRYgzOR4jWqlr7gBTU4DqQobi/oxxYrZPFTf
25Js5ET2yeIhCfusFwqorUXOI7zH/ehA7Om8re6zvWMyc3zMfDOCcI4+BCNF4Dbq
aOWlS1j8GZaK7RtgUDCkk9z0gwZNTKfgJSDmWc7Lh1dsvawcOFAkF2nAZtwSfyxN
//XU90+V0JMJz8sDkqBskidKi2tPi9j09ijqlo7ISBcA72skMzbBxLByo8nkZqv1
2D1OY/tqP6qDjhSwIb9OVf3/sWqRsMn5mz16yQ/KvhslyG8RY8ye8mYpFV6Xb7N3
mWIiDgI15LcjsoNi1MBB2979OI3oNahxaVV9SjxUq8M8zsBGe2IT8mq4KdUunccf
0pCfiebUvJNg+/4pq+d6a3BA+tdzYP5MDNQ6xminkn0wVytxskD3mkD/Jck83nOu
VVQPRV9w
=KxXo
-----END PGP SIGNATURE-----

Timestamp of file with hash fc451b85b7714b6efec31b9a07f211a521da7a434e0bfda8e649fdc21e55b2f6 -

@maflcko maflcko merged commit 816e15e into bitcoin:master Oct 5, 2021
@fanquake fanquake deleted the move_amount_h_consensus branch October 5, 2021 08:23
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 5, 2021
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Oct 10, 2022
Summary:
Move amount.h to consensus/amount.h.
Renames, adds missing and removes uneeded includes.

Also make MAX_MONEY constexpr

This is a backport of [[bitcoin/bitcoin#22951 | core#22951]]

Test Plan:
`ninja all check-all bitcoin-fuzzers bench-bitcoin`

`grep -r "<amount.h>" src/`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D12164
@bitcoin bitcoin locked and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants