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
  • Loading branch information
Wondertan authored Oct 25, 2024
1 parent 2f2c9dd commit d2b99eb
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 d2b99eb

Please sign in to comment.