Skip to content

Commit d532927

Browse files
committed
[core] Ensure that the non-null peersInvolved is used
This is cached because we know the version passed into the method is not guaranteed to be non-null. However, we do have a guarantee that it will be non-null when the final block for a given piece is received, so by the time all blocks are written to disk we will have a non null entry in the cache.
1 parent 59d0208 commit d532927

File tree

1 file changed

+1
-0
lines changed
  • src/MonoTorrent/MonoTorrent.Client/Modes

1 file changed

+1
-0
lines changed

src/MonoTorrent/MonoTorrent.Client/Modes/Mode.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ async void WritePieceAsync (PieceMessage message, IList<IPeer> peersInvolved)
364364

365365
// All blocks have been written for this piece have been written!
366366
BlocksWrittenPerPiece.Remove (message.PieceIndex);
367+
peersInvolved = data.peersInvolved;
367368

368369
// Hashcheck the piece as we now have all the blocks.
369370
byte[] hash;

0 commit comments

Comments
 (0)