Merge branch 'cake-tech:main' into main

This commit is contained in:
Leo 2024-08-08 16:05:02 +08:00 committed by GitHub
commit 52410b6499
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 5 deletions

View file

@ -42,12 +42,16 @@ class Subaddress {
List<Subaddress> getAllSubaddresses() {
final size = monero.Wallet_numSubaddresses(wptr!, accountIndex: subaddress!.accountIndex);
return List.generate(size, (index) {
final list = List.generate(size, (index) {
return Subaddress(
accountIndex: subaddress!.accountIndex,
addressIndex: index,
);
}).reversed.toList();
if (list.length == 0) {
list.add(Subaddress(addressIndex: subaddress!.accountIndex, accountIndex: 0));
}
return list;
}
void addSubaddressSync({required int accountIndex, required String label}) {

View file

@ -131,7 +131,7 @@ void storeSync() async {
return monero.Wallet_synchronized(Pointer.fromAddress(addr));
});
if (lastStorePointer == wptr!.address &&
lastStoreHeight + 5000 < monero.Wallet_blockChainHeight(wptr!) &&
lastStoreHeight + 5000 > monero.Wallet_blockChainHeight(wptr!) &&
!synchronized) {
return;
}

View file

@ -109,7 +109,7 @@ abstract class MoneroWalletAddressesBase extends WalletAddresses with Store {
accountIndex: accountIndex,
defaultLabel: defaultLabel,
usedAddresses: usedAddresses.toList());
subaddress = subaddressList.subaddresses.last;
subaddress = (subaddressList.subaddresses.isEmpty) ? Subaddress(id: 0, address: address, label: defaultLabel) : subaddressList.subaddresses.last;
address = subaddress!.address;
}

View file

@ -41,12 +41,16 @@ class Subaddress {
List<Subaddress> getAllSubaddresses() {
final size = wownero.Wallet_numSubaddresses(wptr!, accountIndex: subaddress!.accountIndex);
return List.generate(size, (index) {
final list = List.generate(size, (index) {
return Subaddress(
accountIndex: subaddress!.accountIndex,
addressIndex: index,
);
}).reversed.toList();
if (list.isEmpty) {
list.add(Subaddress(addressIndex: 0, accountIndex: subaddress!.accountIndex));
}
return list;
}
void addSubaddressSync({required int accountIndex, required String label}) {

View file

@ -109,7 +109,7 @@ abstract class WowneroWalletAddressesBase extends WalletAddresses with Store {
accountIndex: accountIndex,
defaultLabel: defaultLabel,
usedAddresses: usedAddresses.toList());
subaddress = subaddressList.subaddresses.last;
subaddress = (subaddressList.subaddresses.isEmpty) ? Subaddress(id: 0, address: address, label: defaultLabel) : subaddressList.subaddresses.last;
address = subaddress!.address;
}