From 817458a0c31830dc5cd57a7650fe048f89288ed1 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 18 Nov 2024 15:14:20 +0200 Subject: [PATCH] add equals and hashcode to output descriptor --- .../sparrowwallet/drongo/OutputDescriptor.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java b/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java index fb380dd..4857971 100644 --- a/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java +++ b/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java @@ -654,4 +654,21 @@ public class OutputDescriptor { return keyBuilder.toString(); } + + @Override + public final boolean equals(Object o) { + if(this == o) { + return true; + } + if(!(o instanceof OutputDescriptor that)) { + return false; + } + + return toString().equals(that.toString()); + } + + @Override + public int hashCode() { + return toString().hashCode(); + } }