diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/BlockTransactionHashIndex.java b/src/main/java/com/sparrowwallet/drongo/wallet/BlockTransactionHashIndex.java index 6b61b45..0368755 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/BlockTransactionHashIndex.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/BlockTransactionHashIndex.java @@ -9,6 +9,7 @@ public class BlockTransactionHashIndex extends BlockTransactionHash implements C private final long index; private final long value; private BlockTransactionHashIndex spentBy; + private Status status; public BlockTransactionHashIndex(Sha256Hash hash, int height, Date date, Long fee, long index, long value) { this(hash, height, date, fee, index, value, null); @@ -41,6 +42,14 @@ public class BlockTransactionHashIndex extends BlockTransactionHash implements C this.spentBy = spentBy; } + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + @Override public String toString() { return getHash().toString() + ":" + index; diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/FrozenUtxoFilter.java b/src/main/java/com/sparrowwallet/drongo/wallet/FrozenUtxoFilter.java new file mode 100644 index 0000000..6b61dbc --- /dev/null +++ b/src/main/java/com/sparrowwallet/drongo/wallet/FrozenUtxoFilter.java @@ -0,0 +1,8 @@ +package com.sparrowwallet.drongo.wallet; + +public class FrozenUtxoFilter implements UtxoFilter { + @Override + public boolean isEligible(BlockTransactionHashIndex candidate) { + return candidate.getStatus() == null || candidate.getStatus() != Status.FROZEN; + } +} diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/Status.java b/src/main/java/com/sparrowwallet/drongo/wallet/Status.java new file mode 100644 index 0000000..36fdeb2 --- /dev/null +++ b/src/main/java/com/sparrowwallet/drongo/wallet/Status.java @@ -0,0 +1,5 @@ +package com.sparrowwallet.drongo.wallet; + +public enum Status { + FROZEN +}