Skip to content

Commit

Permalink
account for -1
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan committed Mar 27, 2024
1 parent 28fe967 commit c76b0e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion share/shwap/row_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/binary"
"fmt"

blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
mh "github.com/multiformats/go-multihash"
Expand Down Expand Up @@ -111,7 +112,7 @@ func (rid RowID) Verify(root *share.Root) error {
}

sqrLn := len(root.RowRoots)
if int(rid.RowIndex) >= sqrLn {
if int(rid.RowIndex) >= sqrLn-1 {
return fmt.Errorf("RowIndex exceeds square size: %d >= %d", rid.RowIndex, sqrLn)
}

Expand Down

0 comments on commit c76b0e4

Please sign in to comment.