Code example for BigInteger

Methods: compareTo

0
        return height;
    } 
 
    /** Returns true if this objects chainWork is higher than the others. */ 
    public boolean moreWorkThan(StoredBlock other) {
        return chainWork.compareTo(other.chainWork) > 0;
    } 
 
    @Override 
    public boolean equals(Object other) {
        if (!(other instanceof StoredBlock)) return false;
        StoredBlock o = (StoredBlock) other;
        return o.header.equals(header) && o.chainWork.equals(chainWork) && o.height == height;
    } 
 
    @Override 
    public int hashCode() { 
        // A better hashCode is possible, but this works for now. 
        return header.hashCode() ^ chainWork.hashCode() ^ height;
    }