mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-11 17:55:53 +00:00
Implement a hashCode() method on StoredBlock.
This commit is contained in:
parent
668b176283
commit
a95949626e
@ -78,6 +78,12 @@ public class StoredBlock implements Serializable {
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user