From 8dca2ee3f0ba8dbebf88c3629b2a52c7eecf5b89 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 19 Jan 2022 13:48:20 +0200 Subject: [PATCH] add wallet watchLast field --- .../java/com/sparrowwallet/drongo/wallet/Wallet.java | 10 ++++++++++ .../com/sparrowwallet/drongo/wallet/WalletNode.java | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java index 607177f..8c07f9c 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java @@ -41,6 +41,7 @@ public class Wallet extends Persistable implements Comparable { private final Map utxoMixes = new HashMap<>(); private Integer storedBlockHeight; private Integer gapLimit; + private Integer watchLast; private Date birthDate; public Wallet() { @@ -339,6 +340,14 @@ public class Wallet extends Persistable implements Comparable { this.gapLimit = gapLimit; } + public Integer getWatchLast() { + return watchLast; + } + + public void setWatchLast(Integer watchLast) { + this.watchLast = watchLast; + } + public Date getBirthDate() { return birthDate; } @@ -1463,6 +1472,7 @@ public class Wallet extends Persistable implements Comparable { } copy.setStoredBlockHeight(getStoredBlockHeight()); copy.gapLimit = gapLimit; + copy.watchLast = watchLast; copy.birthDate = birthDate; return copy; diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/WalletNode.java b/src/main/java/com/sparrowwallet/drongo/wallet/WalletNode.java index 97fbe33..7012b5b 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/WalletNode.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/WalletNode.java @@ -94,6 +94,10 @@ public class WalletNode extends Persistable implements Comparable { this.children = children; } + public boolean isUsed() { + return !transactionOutputs.isEmpty(); + } + public Set getTransactionOutputs() { return transactionOutputs; }