-
Notifications
You must be signed in to change notification settings - Fork 38.7k
tx pool: Use class methods to hide raw map iterator impl details #13793
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
Conversation
091e7d7 to
fa752b7
Compare
src/txmempool.cpp
Outdated
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.
nit: whitespace
src/txmempool.cpp
Outdated
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.
nit: whitespace
src/txmempool.cpp
Outdated
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.
nit: txiter instead of auto?
Note to 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. |
kallewoof
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.
utACK fa752b748058a0b48b151d2d3016dcfed2629087
src/txmempool.h
Outdated
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.
Nit: the name sounds like it's a getter + setter operator. Maybe call it GetIterSet?
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.
Renamed to GetIterSet according to your feedback
src/validation.cpp
Outdated
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.
Nit: I think the convention is to not prefix variables with types anymore and to use snake_case.
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.
It is used in a couple of places further down, so I will keep the name for now.
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.
Weird, it looked like you renamed itConflicting to ptxConflicting, but ptxConflicting existed already. My bad.
fa752b7 to
fa7b11e
Compare
kallewoof
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.
utACK fa7b11eca5858d3c253dc12d146c50cde5763797
src/txmempool.cpp
Outdated
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.
as the result is only ever used to iterate over, and the input is already unique, does this need to return a set? I guess a std::list would be a better match
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.
OK I guess I'm wrong, there might be duplicate parents
|
utACK fa7b11eca5858d3c253dc12d146c50cde5763797 |
fa7b11e to
fab109c
Compare
|
Rebased |
6daa3d5 to
fa9b098
Compare
fa9b098 to
faa1a74
Compare
…l details faa1a74 tx pool: Use class methods to hide raw map iterator impl details (MarcoFalke) Pull request description: ATMP et al would often use map iterator implementation details such as `end()` or `find()`, which is acceptable in current code. However, this not only makes it impossible to turn the maps into private members in the future but also makes it harder to replace the maps with different data structures. This is required for and split off of #13804 Tree-SHA512: 4f9017fd1d98d9df49d25bba92655a4a97755eea161fd1cbb565ceb81bbc2b4924129d214f8a29563a77e3d8eef85a67c81245ecdc9a9e5292d419922a93cb88
…tor impl details faa1a74 tx pool: Use class methods to hide raw map iterator impl details (MarcoFalke) Pull request description: ATMP et al would often use map iterator implementation details such as `end()` or `find()`, which is acceptable in current code. However, this not only makes it impossible to turn the maps into private members in the future but also makes it harder to replace the maps with different data structures. This is required for and split off of bitcoin#13804 Tree-SHA512: 4f9017fd1d98d9df49d25bba92655a4a97755eea161fd1cbb565ceb81bbc2b4924129d214f8a29563a77e3d8eef85a67c81245ecdc9a9e5292d419922a93cb88
…tor impl details faa1a74 tx pool: Use class methods to hide raw map iterator impl details (MarcoFalke) Pull request description: ATMP et al would often use map iterator implementation details such as `end()` or `find()`, which is acceptable in current code. However, this not only makes it impossible to turn the maps into private members in the future but also makes it harder to replace the maps with different data structures. This is required for and split off of bitcoin#13804 Tree-SHA512: 4f9017fd1d98d9df49d25bba92655a4a97755eea161fd1cbb565ceb81bbc2b4924129d214f8a29563a77e3d8eef85a67c81245ecdc9a9e5292d419922a93cb88
ATMP et al would often use map iterator implementation details such as
end()orfind(), which is acceptable in current code.However, this not only makes it impossible to turn the maps into private members in the future but also makes it harder to replace the maps with different data structures.
This is required for and split off of #13804