Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions lib/wallets/wallet/impl/epiccash_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -299,26 +299,19 @@ class EpiccashWallet extends Bip39Wallet {
}
}

/// Only index 0 is currently used in stack wallet.
Future<Address> _generateAndStoreReceivingAddressForIndex(
int index,
) async {
Address? address = await getCurrentReceivingAddress();

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);
// 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");
}

final epicBoxConfig = await getEpicBoxConfig();
final address = await thisWalletAddress(index, epicBoxConfig);

if (info.cachedReceivingAddress != address.value) {
await info.updateReceivingAddress(
newAddress: address.value,
Expand Down Expand Up @@ -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;
Expand Down
Loading