Remove unused and confusing CTransaction constructor#20588
Merged
fanquake merged 2 commits intobitcoin:masterfrom Dec 13, 2020
Merged
Remove unused and confusing CTransaction constructor#20588fanquake merged 2 commits intobitcoin:masterfrom
fanquake merged 2 commits intobitcoin:masterfrom
Conversation
laanwj
reviewed
Dec 7, 2020
Member
|
I kind of wish |
c86ecca to
fac39c1
Compare
Contributor
|
Concept ACK |
Member
|
Thank, looks good to me now. |
promag
reviewed
Dec 10, 2020
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Dec 13, 2020
ryanofsky
added a commit
to ryanofsky/libmultiprocess
that referenced
this pull request
Dec 18, 2020
CTransaction default constructor was removed in faac31521bb7ecbf999541cf918d3750ff589de4 bitcoin/bitcoin#20588 which exposed two places where libmultiprocess was inadvertently assuming default constructors were defined. In both places, it would never actually call the default constructor at runtime, just rely on it being present during compile time code generation. In the first case, compiler would fail while trying to figure out the type of `std::invoke_result_t<EmplaceFn>` where EmplaceFn called `make_shared<CTransaction>()`. This was fixed by just the moving expression into an unexpanded template method. In the second case code was calling Optional<CTransaction>::emplace() to default-initialize CTransaction& output-arguments. It was fixed by moving into a constexpr-if that would be known to be false for output arguments at compile time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The constructor is confusing and dangerous (as explained in the TODO), fix that by removing it.