mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-25 15:10:18 +01:00
InventoryItem.hashCode()
Conflicts: core/src/main/java/com/google/bitcoin/core/InventoryItem.java
This commit is contained in:
parent
d88d421de6
commit
60220aa62d
1 changed files with 10 additions and 0 deletions
|
@ -42,4 +42,14 @@ public class InventoryItem {
|
|||
public String toString() {
|
||||
return type.toString() + ": " + hash;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return hash.hashCode() + type.ordinal();
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof InventoryItem &&
|
||||
((InventoryItem)o).type == this.type &&
|
||||
((InventoryItem)o).hash.equals(this.hash);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue