mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-26 01:56:44 +00:00
add support for freezing utxos
This commit is contained in:
parent
6b20c6558a
commit
deb45687c0
3 changed files with 22 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.sparrowwallet.drongo.wallet;
|
||||
|
||||
public enum Status {
|
||||
FROZEN
|
||||
}
|
Loading…
Reference in a new issue