/** * 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); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UnspentTx unspentTx = (UnspentTx) o; if (txPos != unspentTx.txPos) return false; if (value != unspentTx.value) return false; if (!txHash.equals(unspentTx.txHash)) return false; return true; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; InventoryItem other = (InventoryItem) o; return type == other.type && hash.equals(other.hash); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UnspentTx unspentTx = (UnspentTx) o; if (txPos != unspentTx.txPos) return false; if (value != unspentTx.value) return false; if (!txHash.equals(unspentTx.txHash)) return false; return true; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UTXOsMessage other = (UTXOsMessage) o; return height == other.height && chainHead.equals(other.chainHead) && Arrays.equals(heights, other.heights) && Arrays.equals(hits, other.hits) && outputs.equals(other.outputs); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GetBlocksMessage other = (GetBlocksMessage) o; return version == other.version && stopHash.equals(other.stopHash) && locator.size() == other.locator.size() && locator.containsAll(other.locator); // ignores locator ordering }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GetBlocksMessage other = (GetBlocksMessage) o; return version == other.version && stopHash.equals(other.stopHash) && locator.size() == other.locator.size() && locator.containsAll(other.locator); // ignores locator ordering }
/** * Compares two getheaders messages. Note that even though they are structurally identical a GetHeadersMessage * will not compare equal to a GetBlocksMessage containing the same data. */ @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GetHeadersMessage other = (GetHeadersMessage) o; return version == other.version && stopHash.equals(other.stopHash) && locator.size() == other.locator.size() && locator.containsAll(other.locator); // ignores locator ordering }
/** * Compares two getheaders messages. Note that even though they are structurally identical a GetHeadersMessage * will not compare equal to a GetBlocksMessage containing the same data. */ @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GetHeadersMessage other = (GetHeadersMessage) o; return version == other.version && stopHash.equals(other.stopHash) && locator.size() == other.locator.size() && locator.containsAll(other.locator); // ignores locator ordering }
@Override public Channel getChannel (Sha256Hash hash) { synchronized (channelList) { Optional<Channel> optional = channelList.stream().filter(channel1 -> channel1.getHash().equals(hash)).findAny(); if (optional.isPresent()) { return optional.get(); } else { throw new RuntimeException("Channel not found.."); } } }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BitTransaction other = (BitTransaction) o; return getHash().equals(other.getHash()); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NxtTransaction other = (NxtTransaction) o; return getHash().equals(other.getHash()); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; return getHash().equals(((Transaction)o).getHash()); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; return getHash().equals(((Block)o).getHash()); }
private void checkMerkleRoot() throws VerificationException { Sha256Hash calculatedRoot = calculateMerkleRoot(); if (!calculatedRoot.equals(merkleRoot)) { log.error("Merkle tree did not verify"); throw new VerificationException("Merkle hashes do not match: " + calculatedRoot + " vs " + merkleRoot); } }
public boolean equals(Object o) { MasternodePing mnp = (MasternodePing)o; if(mnp.sigTime == this.sigTime && mnp.vin.equals(this.vin) && mnp.vchSig.equals(this.vchSig) && mnp.blockHash.equals(this.blockHash)) { return true; } return false; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AuxPoW input = (AuxPoW) o; if (!transaction.equals(input.transaction)) return false; if (!hashBlock.equals(input.hashBlock)) return false; if (!coinbaseBranch.equals(input.coinbaseBranch)) return false; if (!chainMerkleBranch.equals(input.chainMerkleBranch)) return false; if (!parentBlockHeader.equals(input.parentBlockHeader)) return false; return getHash().equals(input.getHash()); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TrimmedOutPoint other = (TrimmedOutPoint) o; return getIndex() == other.getIndex() && getHash().equals(other.getHash()); } }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TransactionOutPoint other = (TransactionOutPoint) o; return getIndex() == other.getIndex() && getHash().equals(other.getHash()); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UTXO other = (UTXO) o; return getIndex() == other.getIndex() && getHash().equals(other.getHash()); }