Skip to content
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

p2p: session.getRangeByHeight should change condition check from == to >= given that the number of headers being appended is more than 1 at a time #225

Open
odeke-em opened this issue Oct 22, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@odeke-em
Copy link

if uint64(len(headers)) == amount {

should be changed to >= from == given that right above you added what could be more than just 1 header.

Kindly cc-ing @Wondertan @walldiss

@odeke-em odeke-em changed the title p2p: session.getRangeByHeight should change condition check from == to >= given that the number of headers being is more than 1 at a time p2p: session.getRangeByHeight should change condition check from == to >= given that the number of headers being appended is more than 1 at a time Oct 22, 2024
@walldiss
Copy link
Member

walldiss commented Oct 29, 2024

Right now, it's impossible for len(headers) to exceed amount, but you're absolutely right - it makes sense to update the check to >= for better safety.

@walldiss walldiss added the good first issue Good for newcomers label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants