mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-03 05:57:21 +00:00
InventoryItem.hashCode()
Conflicts: core/src/main/java/com/google/bitcoin/core/InventoryItem.java
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user