update libepiccash and fix odd address error caused by some odd code

This commit is contained in:
julian 2024-11-21 11:08:13 -06:00 committed by julian-CStack
parent 9c9a9f8d3e
commit db7422a100
2 changed files with 9 additions and 18 deletions

@ -1 +1 @@
Subproject commit 1d48c0a8aa394324e7c39267e5654038834aff95
Subproject commit 0bb1b1ced6e0d3c66e383698f89825754c692986

View file

@ -299,25 +299,18 @@ class EpiccashWallet extends Bip39Wallet {
}
}
/// Only index 0 is currently used in stack wallet.
Future<Address> _generateAndStoreReceivingAddressForIndex(
int index,
) async {
Address? address = await getCurrentReceivingAddress();
// Since only 0 is a valid index in stack wallet at this time, lets just
// throw is not zero
if (index != 0) {
throw Exception("Invalid/unexpected address index used");
}
if (address != null) {
final splitted = address.value.split('@');
//Check if the address is the same as the current epicbox domain
//Since we're only using one epicbpox now this doesn't apply but will be
// useful in the future
final epicboxConfig = await getEpicBoxConfig();
if (splitted[1] != epicboxConfig.host) {
//Update the address
address = await thisWalletAddress(index, epicboxConfig);
}
} else {
final epicboxConfig = await getEpicBoxConfig();
address = await thisWalletAddress(index, epicboxConfig);
}
final epicBoxConfig = await getEpicBoxConfig();
final address = await thisWalletAddress(index, epicBoxConfig);
if (info.cachedReceivingAddress != address.value) {
await info.updateReceivingAddress(
@ -948,8 +941,6 @@ class EpiccashWallet extends Bip39Wallet {
final slatesToCommits = info.epicData?.slatesToCommits ?? {};
for (final tx in transactions) {
Logging.instance.log("tx: $tx", level: LogLevel.Info);
final isIncoming =
tx.txType == epic_models.TransactionType.TxReceived ||
tx.txType == epic_models.TransactionType.TxReceivedCancelled;