avoid npe loading new wallets with watchlast set

This commit is contained in:
Craig Raw 2022-03-28 09:40:31 +02:00
parent 79c0f7769a
commit ba199ff11b

View file

@ -348,7 +348,7 @@ public class ElectrumServer {
private Set<WalletNode> getAddressNodes(Wallet wallet, WalletNode purposeNode) { private Set<WalletNode> getAddressNodes(Wallet wallet, WalletNode purposeNode) {
Integer watchLast = wallet.getWatchLast(); Integer watchLast = wallet.getWatchLast();
if(watchLast == null || watchLast < wallet.getGapLimit() || wallet.getStoredBlockHeight() == 0 || wallet.getTransactions().isEmpty()) { if(watchLast == null || watchLast < wallet.getGapLimit() || wallet.getStoredBlockHeight() == null || wallet.getStoredBlockHeight() == 0 || wallet.getTransactions().isEmpty()) {
return purposeNode.getChildren(); return purposeNode.getChildren();
} }