i2psnark: Don't decrement downloaded counter after receiving bad piece

Received reports of counter going negative
This commit is contained in:
zzz
2021-01-12 08:23:36 -05:00
parent ccb0c279f7
commit a424331b78

View File

@@ -1068,7 +1068,8 @@ class PeerCoordinator implements PeerListener
// just in case
removePartialPiece(piece);
// Oops. We didn't actually download this then... :(
downloaded.addAndGet(0 - metainfo.getPieceLength(piece));
// Reports of counter going negative?
//downloaded.addAndGet(0 - metainfo.getPieceLength(piece));
// Mark this peer as not having the piece. PeerState will update its bitfield.
for (Piece pc : wantedPieces) {
if (pc.getId() == piece) {