TransactionInput, TransactionOutput: compare parent tx using equals() not object reference

This commit is contained in:
Sean Gilligan 2023-04-03 20:22:27 -07:00 committed by Andreas Schildbach
parent 7ef88e709e
commit 5f510d777b
2 changed files with 2 additions and 2 deletions

View File

@ -563,7 +563,7 @@ public class TransactionInput {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TransactionInput other = (TransactionInput) o;
return sequence == other.sequence && parent == other.parent
return sequence == other.sequence && parent != null && parent.equals(other.parent)
&& outpoint.equals(other.outpoint) && Arrays.equals(scriptBytes, other.scriptBytes);
}

View File

@ -443,7 +443,7 @@ public class TransactionOutput extends Message {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TransactionOutput other = (TransactionOutput) o;
return value == other.value && (parent == null || (parent == other.parent && getIndex() == other.getIndex()))
return value == other.value && (parent == null || (parent.equals(other.parent) && getIndex() == other.getIndex()))
&& Arrays.equals(scriptBytes, other.scriptBytes);
}