Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Jul 25, 2022

It involves calculating two hashes, so the performance impact should be
made explicit.

Also, add the module to iwyu.

It involves calculating two hashes, so the performance impact should be
made explicit.

Also, add the module to iwyu.
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 fa2247a, I have reviewed the code and it looks OK, I agree it can be merged.

@aureleoules
Copy link
Contributor

ACK fa2247a.
In my understanding, these changes disable copy-initialization of CTransaction to avoid potentially hashing twice.

On a related note, should we make all single-argument constructors explicit ?
https://github.com/isocpp/CppCoreGuidelines/blob/6f27719b2b994d1304f78194dc7824e4ddeea5f5/CppCoreGuidelines.md#c46-by-default-declare-single-argument-constructors-explicit

@maflcko
Copy link
Member Author

maflcko commented Jul 25, 2022

In my understanding, these changes disable copy-initialization of CTransaction to avoid potentially hashing twice.

Not sure what you mean, but this should not change any constructor or code logic. This simply forces devs to write CTransaction at least once if they want to construct one.

On a related note, should we make all single-argument constructors explicit ?
https://github.com/isocpp/CppCoreGuidelines/blob/6f27719b2b994d1304f78194dc7824e4ddeea5f5/CppCoreGuidelines.md#c46-by-default-declare-single-argument-constructors-explicit

Probably not, as the url you link to advises against that.

@DrahtBot
Copy link
Contributor

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #17529 (rpc: Faster getblock using PureBlock by MarcoFalke)

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.

@maflcko maflcko merged commit c90f86e into bitcoin:master Jul 26, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 27, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Jul 26, 2023
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.

4 participants