Example #1
0
					sources.forEach(function(wire) {
						var now = Date.now();

						wire.badPieceStrikes = wire.badPieceStrikes.filter(function(strike) {
							return (now - strike) < BAD_PIECE_STRIKES_DURATION;
						});

						wire.badPieceStrikes.push(now);

						if (wire.badPieceStrikes.length > BAD_PIECE_STRIKES_MAX) {
							engine.block(wire.peerAddress);
						}
					});