From e8f9e329a76c9ec79c79201d8325b02e013840d6 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 29 Mar 2019 15:06:23 +0200 Subject: [PATCH] Fix address hashing --- .../java/com/craigraw/drongo/TransactionTask.java | 2 +- .../java/com/craigraw/drongo/address/Address.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/craigraw/drongo/TransactionTask.java b/src/main/java/com/craigraw/drongo/TransactionTask.java index 9dacb27..e5f5ffd 100644 --- a/src/main/java/com/craigraw/drongo/TransactionTask.java +++ b/src/main/java/com/craigraw/drongo/TransactionTask.java @@ -74,7 +74,7 @@ public class TransactionTask implements Runnable { } builder.append(outputJoiner.toString()); - log.info(builder.toString()); + log.debug(builder.toString()); checkWallet(transaction); } diff --git a/src/main/java/com/craigraw/drongo/address/Address.java b/src/main/java/com/craigraw/drongo/address/Address.java index d82441d..94f9337 100644 --- a/src/main/java/com/craigraw/drongo/address/Address.java +++ b/src/main/java/com/craigraw/drongo/address/Address.java @@ -25,4 +25,17 @@ public abstract class Address { public abstract int getVersion(); public abstract Script getOutputScript(); + + public boolean equals(Object obj) { + if(!(obj instanceof Address)) { + return false; + } + + Address address = (Address)obj; + return address.getAddress().equals(this.getAddress()); + } + + public int hashCode() { + return getAddress().hashCode(); + } }