Get rid of lastUsedSubaddress in AddressService

This commit is contained in:
pokkst 2022-11-22 11:20:58 -06:00
parent e90462707c
commit 80a7e234ac
No known key found for this signature in database
GPG key ID: 90C2ED85E67A50FF

View file

@ -15,7 +15,6 @@ import java.util.Locale;
public class AddressService extends ServiceBase {
public static AddressService instance = null;
private int latestAddressIndex = 1;
private int lastUsedSubaddress = 0;
public AddressService(MoneroHandlerThread thread) {
super(thread);
@ -27,18 +26,9 @@ public class AddressService extends ServiceBase {
}
public void refreshAddresses() {
List<TransactionInfo> localTransactionList = new ArrayList<>(HistoryService.getInstance().getHistory());
for (TransactionInfo info : localTransactionList) {
if (info.addressIndex > lastUsedSubaddress)
lastUsedSubaddress = info.addressIndex;
}
latestAddressIndex = WalletManager.getInstance().getWallet().getNumSubaddresses();
}
public int getLastUsedSubaddress() {
return lastUsedSubaddress;
}
public int getLatestAddressIndex() {
return latestAddressIndex;
}