save block height for current stored transactions

This commit is contained in:
Craig Raw 2020-06-10 16:14:57 +02:00
parent 0d56692784
commit 728b6ce5ef

View file

@ -22,6 +22,7 @@ public class Wallet {
private List<Keystore> keystores = new ArrayList<>();
private final Set<WalletNode> purposeNodes = new TreeSet<>();
private final Map<Sha256Hash, BlockTransaction> transactions = new HashMap<>();
private Integer storedBlockHeight;
public Wallet() {
}
@ -86,6 +87,14 @@ public class Wallet {
return transactions;
}
public Integer getStoredBlockHeight() {
return storedBlockHeight;
}
public void setStoredBlockHeight(Integer storedBlockHeight) {
this.storedBlockHeight = storedBlockHeight;
}
public WalletNode getNode(KeyPurpose keyPurpose) {
WalletNode purposeNode;
Optional<WalletNode> optionalPurposeNode = purposeNodes.stream().filter(node -> node.getKeyPurpose().equals(keyPurpose)).findFirst();