Coverage Summary for Class: ScoringCalculator (co.rsk.scoring)

Class Class, % Method, % Line, %
ScoringCalculator 0% (0/1) 0% (0/2) 0% (0/4)


1 package co.rsk.scoring; 2  3 /** 4  * ScoringCalculator calculates the reputation of a peer 5  * <p> 6  * Created by ajlopez on 30/06/2017. 7  */ 8 public class ScoringCalculator { 9  /** 10  * Calculates the reputation of a peer scoring 11  * 12  * Current implementation assigns not good reputation to peers 13  * having any invalid transaction or invalid block recorded events 14  * 15  * @param scoring the scoring of the peer 16  * @return <tt>true</tt> if the peer has good reputation 17  */ 18  public boolean hasGoodReputation(PeerScoring scoring) { 19  //TODO(lsebrie): implement empty messages as responses so timeout can be handled as it should 20  return scoring.getEventCounter(EventType.INVALID_BLOCK) < 1 && 21  scoring.getEventCounter(EventType.INVALID_MESSAGE) < 1 && 22  scoring.getEventCounter(EventType.INVALID_HEADER) < 1; 23  } 24 }