コード例 #1
0
 /** Returns true if the given height has a recorded checkpoint. */
 public boolean isCheckpoint(int height) {
   Sha256Hash checkpointHash = checkpoints.get(height);
   return checkpointHash != null;
 }
コード例 #2
0
 /**
  * Returns true if the block height is either not a checkpoint, or is a checkpoint and the hash
  * matches.
  */
 public boolean passesCheckpoint(int height, Sha256Hash hash) {
   Sha256Hash checkpointHash = checkpoints.get(height);
   return checkpointHash == null || checkpointHash.equals(hash);
 }