Skip to content

Conversation

dergoegge
Copy link
Member

This addresses my review comments I left on #22910.

This has no effect on the current logic as nStartByte is only used for internal addresses which only ever add 10 whole bytes to the returned group. However to avoid future bugs, I think we should use nStartByte as offset for the last byte as well, in case we ever add a new address type that makes makes use of nStartByte and adds fractional bytes to the group.

Should we ever introduce a new address type that makes use of
`nStartByte` and adds fractional bytes to the group, then nStartByte
should be used as the offset for the last byte.
@fanquake fanquake requested a review from jnewbery April 25, 2022 13:28
@fanquake fanquake added the P2P label Apr 25, 2022
@jnewbery
Copy link
Contributor

Code review ACK e5d1831

Thanks!

@fanquake fanquake requested a review from mzumsande April 26, 2022 19:14
Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

Concept and code-review ACK e5d1831

@fanquake fanquake merged commit 33aaf43 into bitcoin:master May 4, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 4, 2022
e5d1831 [netgroup] Use nStartByte as offset for the last byte of the group (dergoegge)

Pull request description:

  This addresses my review [comments](bitcoin#22910 (comment)) I left on bitcoin#22910.

  This has no effect on the current logic as `nStartByte` is only used for internal addresses which only ever add 10 whole bytes to the returned group. However to avoid future bugs, I think we should use `nStartByte` as offset for the last byte as well, in case we ever add a new address type that makes makes use of `nStartByte` and adds fractional bytes to the group.

ACKs for top commit:
  jnewbery:
    Code review ACK e5d1831
  theStack:
    Concept and code-review ACK e5d1831

Tree-SHA512: 4c08c7d6cb38b553e998798b3e3b790177aaa2141a48e277dfd538e01a7fccadf644329e93c5b0fb5e7e4037494c8dfe061b94eb52c6b31dc21bdf99eb0e311a
@bitcoin bitcoin locked and limited conversation to collaborators May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants