refactor: move update_* structs from txmempool.h to .cpp file#23211
Merged
maflcko merged 2 commits intobitcoin:masterfrom Nov 3, 2021
Merged
refactor: move update_* structs from txmempool.h to .cpp file#23211maflcko merged 2 commits intobitcoin:masterfrom
update_* structs from txmempool.h to .cpp file#23211maflcko merged 2 commits intobitcoin:masterfrom
Conversation
These helpers are exclusively used in txmempool.cpp, hence they should also be moved there. Can be reviewed with "--color-moved=dimmed-zebra".
Contributor
|
Concept ACK |
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
promag
reviewed
Oct 15, 2021
| CTxMemPoolEntry::Parents parents = it->GetMemPoolParents(); | ||
| const CTxMemPoolEntry::Parents& parents = it->GetMemPoolParentsConst(); | ||
| // add or remove this tx as a child of each parent | ||
| for (const CTxMemPoolEntry& parent : parents) { |
Contributor
There was a problem hiding this comment.
Note that parent can be non-const. Maybe GetMemPoolParentsConst should return std::set<const CTxMemPoolEntryRef, CompareIteratorByHash> instead.
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Nov 3, 2021
….h to .cpp file 65aaf94 refactor: move `update_*` structs from txmempool.h to .cpp file (Sebastian Falbesoner) 9947ce6 refactor: use const reference for parents in `CTxMemPool::UpdateAncestorsOf` (Sebastian Falbesoner) Pull request description: These helpers are exclusively used in txmempool.cpp, hence they should also be moved there. The PR also contains a commit which fixes const-correctness for parents in `CTxMemPool::UpdateAncestorsOf` and declares them as reference to avoid a copy. ACKs for top commit: promag: Code review ACK 65aaf94. Verified move-only commit locally. Tree-SHA512: 7ce29f3ba0e68b5355001f27725b00f6d54cc993015356eb40b61b8cdd17db49b980f4c3d798c8e0c940d245dc3a72c474bb9ff3c0ee971ead450786076812c2
Fabcien
pushed a commit
to Bitcoin-ABC/bitcoin-abc
that referenced
this pull request
Oct 19, 2022
Summary: > refactor: use const reference for parents in `CTxMemPool::UpdateAncestorsOf` > refactor: move update_* structs from txmempool.h to .cpp file > > These helpers are exclusively used in txmempool.cpp, hence they > should also be moved there. > > Can be reviewed with "--color-moved=dimmed-zebra". This is a backport of [[bitcoin/bitcoin#23211 | core#23211]] Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, sdulfari Reviewed By: #bitcoin_abc, sdulfari Subscribers: sdulfari Differential Revision: https://reviews.bitcoinabc.org/D12287
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.
These helpers are exclusively used in txmempool.cpp, hence they should also be moved there. The PR also contains a commit which fixes const-correctness for parents in
CTxMemPool::UpdateAncestorsOfand declares them as reference to avoid a copy.