mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-24 06:47:54 +01:00
Implement a hashCode() method on StoredBlock.
This commit is contained in:
parent
668b176283
commit
a95949626e
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue