Skip to content

Commit

Permalink
bitswap(session): fix slice prealloc (#702)
Browse files Browse the repository at this point in the history
bitswap(session): fix slice prealloc

(cherry picked from commit d2b99eb)
  • Loading branch information
Wondertan authored and gammazero committed Oct 25, 2024
1 parent 8585b82 commit 78817b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The following emojis are used to highlight certain changes:

### Fixed

- Fix panic if current live count is greater than broadcast limit [#702](https://github.com/ipfs/boxo/pull/702)

### Security

## [v0.24.1]
Expand Down
2 changes: 1 addition & 1 deletion bitswap/client/internal/session/sessionwants.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (sw *sessionWants) GetNextWants() []cid.Cid {
currentLiveCount := len(sw.liveWants)
toAdd := sw.broadcastLimit - currentLiveCount
liveSize := min(toAdd, sw.toFetch.Len())
if liveSize == 0 {
if liveSize <= 0 {
return nil
}

Expand Down

0 comments on commit 78817b5

Please sign in to comment.