-
Notifications
You must be signed in to change notification settings - Fork 38.6k
refactor: move update_* structs from txmempool.h to .cpp file
#23211
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
refactor: move update_* structs from txmempool.h to .cpp file
#23211
Conversation
These helpers are exclusively used in txmempool.cpp, hence they should also be moved there. Can be reviewed with "--color-moved=dimmed-zebra".
|
Concept ACK |
|
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK 65aaf94. Verified move-only commit locally.
| 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that parent can be non-const. Maybe GetMemPoolParentsConst should return std::set<const CTxMemPoolEntryRef, CompareIteratorByHash> instead.
….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
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
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.