add support for freezing utxos

This commit is contained in:
Craig Raw 2020-12-01 12:44:47 +02:00
parent 6b20c6558a
commit deb45687c0
3 changed files with 22 additions and 0 deletions

View file

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

View file

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

View file

@ -0,0 +1,5 @@
package com.sparrowwallet.drongo.wallet;
public enum Status {
FROZEN
}