Skip to content

dcrutil: Correct off-by-1 index check.#2991

Merged
davecgh merged 1 commit intodecred:masterfrom
norwnd:dcrutil-off-by-one-index-check
Aug 30, 2022
Merged

dcrutil: Correct off-by-1 index check.#2991
davecgh merged 1 commit intodecred:masterfrom
norwnd:dcrutil-off-by-one-index-check

Conversation

@norwnd
Copy link
Copy Markdown
Contributor

@norwnd norwnd commented Aug 28, 2022

Hi, I was reading through this section of the code when I noticed what seems to be a 1-off issue,

even though I couldn't find the affected funcs being used in dcrd code-base (besides tests), I assume:

  • they might be utilised in the future
  • external packages might use these

Copy link
Copy Markdown
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Good catch!

I don't really expect it will ever be used and I'm really not even sure why it was added, but since it's there, I agree that it should be correct.

As a bit of an aside, ultimately, the plan is to entirely remove dcrutil.Block and dcrutil.Tx as discussed a bit in #2786.

@davecgh davecgh changed the title dcrutil: off-by-1 index check dcrutil: Correct off-by-1 index check. Aug 28, 2022
@davecgh davecgh merged commit 198d1d2 into decred:master Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants