Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vintikzzz authored May 19, 2023
1 parent 56c8b39 commit e6a38b1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions torrent-piece-request-order.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ func (t *Torrent) updatePieceRequestOrder(pieceIndex int) {
if t.storage == nil {
return
}
t.cl.pieceRequestOrder[t.clientPieceRequestOrderKey()].Update(
t.pieceRequestOrderKey(pieceIndex),
t.requestStrategyPieceOrderState(pieceIndex))
if ro, ok := t.cl.pieceRequestOrder[t.clientPieceRequestOrderKey()]; ok {
ro.Update(
t.pieceRequestOrderKey(pieceIndex),
t.requestStrategyPieceOrderState(pieceIndex))
}
}

func (t *Torrent) clientPieceRequestOrderKey() interface{} {
Expand Down

0 comments on commit e6a38b1

Please sign in to comment.