InventoryItem.hashCode()

Conflicts:
	core/src/main/java/com/google/bitcoin/core/InventoryItem.java
This commit is contained in:
Matt Corallo 2013-07-23 18:22:44 +02:00 committed by Mike Hearn
parent d88d421de6
commit 60220aa62d

View file

@ -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);
}
}