mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-09 20:53:47 +01:00
i think for 1.0 i won't include a subaddress list/screen, so remove these methods for now
This commit is contained in:
parent
4674e81040
commit
67ab38d91f
@ -4,6 +4,8 @@ import com.m2049r.xmrwallet.data.Subaddress;
|
|||||||
import com.m2049r.xmrwallet.model.TransactionInfo;
|
import com.m2049r.xmrwallet.model.TransactionInfo;
|
||||||
import com.m2049r.xmrwallet.model.Wallet;
|
import com.m2049r.xmrwallet.model.Wallet;
|
||||||
import com.m2049r.xmrwallet.model.WalletManager;
|
import com.m2049r.xmrwallet.model.WalletManager;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class AddressService extends ServiceBase {
|
public class AddressService extends ServiceBase {
|
||||||
@ -13,7 +15,6 @@ public class AddressService extends ServiceBase {
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final HashMap<String, Integer> subAddresses = new HashMap<>();
|
|
||||||
private int latestAddressIndex = 1;
|
private int latestAddressIndex = 1;
|
||||||
|
|
||||||
public AddressService(MoneroHandlerThread thread) {
|
public AddressService(MoneroHandlerThread thread) {
|
||||||
@ -22,16 +23,6 @@ public class AddressService extends ServiceBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void refreshAddresses() {
|
public void refreshAddresses() {
|
||||||
Wallet wallet = WalletManager.getInstance().getWallet();
|
|
||||||
int issuedAddressesSize = WalletManager.getInstance().getWallet().getNumSubaddresses();
|
|
||||||
if(subAddresses.size() != issuedAddressesSize) {
|
|
||||||
for (int i = 0; i < issuedAddressesSize; i++) {
|
|
||||||
if(!subAddresses.containsValue(i)) {
|
|
||||||
subAddresses.put(wallet.getSubaddress(i), i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (TransactionInfo info : HistoryService.getInstance().getHistory()) {
|
for (TransactionInfo info : HistoryService.getInstance().getHistory()) {
|
||||||
if(info.addressIndex > latestAddressIndex) {
|
if(info.addressIndex > latestAddressIndex) {
|
||||||
latestAddressIndex = info.addressIndex;
|
latestAddressIndex = info.addressIndex;
|
||||||
@ -47,8 +38,4 @@ public class AddressService extends ServiceBase {
|
|||||||
Wallet wallet = WalletManager.getInstance().getWallet();
|
Wallet wallet = WalletManager.getInstance().getWallet();
|
||||||
return wallet.getSubaddressObject(latestAddressIndex);
|
return wallet.getSubaddressObject(latestAddressIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, Integer> getIssuedSubaddresses() {
|
|
||||||
return subAddresses;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user