mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-30 19:41:24 +00:00
Implement a hashCode() method on StoredBlock.
This commit is contained in:
@@ -78,6 +78,12 @@ public class StoredBlock implements Serializable {
|
|||||||
return o.header.equals(header) && o.chainWork.equals(chainWork) && o.height == height;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new StoredBlock, calculating the additional fields by adding to the values in this block.
|
* Creates a new StoredBlock, calculating the additional fields by adding to the values in this block.
|
||||||
|
Reference in New Issue
Block a user