Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Jul 29, 2018

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

@maflcko maflcko force-pushed the Mf1808-hideATMPiterators branch 2 times, most recently from 091e7d7 to fa752b7 Compare July 29, 2018 14:32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: whitespace

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: whitespace

Copy link
Contributor

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?

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 30, 2018

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.

Copy link
Contributor

@kallewoof kallewoof left a 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
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

@maflcko maflcko force-pushed the Mf1808-hideATMPiterators branch from fa752b7 to fa7b11e Compare July 30, 2018 20:06
Copy link
Contributor

@kallewoof kallewoof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK fa7b11eca5858d3c253dc12d146c50cde5763797

Copy link
Member

@laanwj laanwj Aug 29, 2018

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

Copy link
Member

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

@laanwj
Copy link
Member

laanwj commented Aug 29, 2018

utACK fa7b11eca5858d3c253dc12d146c50cde5763797

@maflcko maflcko force-pushed the Mf1808-hideATMPiterators branch from fa7b11e to fab109c Compare August 29, 2018 14:55
@maflcko
Copy link
Member Author

maflcko commented Aug 29, 2018

Rebased

@maflcko maflcko force-pushed the Mf1808-hideATMPiterators branch 2 times, most recently from 6daa3d5 to fa9b098 Compare September 7, 2018 14:18
@maflcko maflcko force-pushed the Mf1808-hideATMPiterators branch from fa9b098 to faa1a74 Compare September 7, 2018 17:04
@laanwj laanwj merged commit faa1a74 into bitcoin:master Sep 10, 2018
laanwj added a commit that referenced this pull request Sep 10, 2018
…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
@maflcko maflcko deleted the Mf1808-hideATMPiterators branch December 29, 2020 13:56
5tefan added a commit to 5tefan/dash that referenced this pull request Aug 10, 2021
…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
5tefan added a commit to 5tefan/dash that referenced this pull request Aug 12, 2021
…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
UdjinM6 added a commit to dashpay/dash that referenced this pull request Aug 13, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
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.

5 participants