mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 11:59:30 +00:00
Update address to match epicbox config
This commit is contained in:
parent
7cebd31268
commit
ed42dba9cc
1 changed files with 9 additions and 1 deletions
|
@ -317,6 +317,7 @@ class EpiccashWallet extends Bip39Wallet {
|
|||
Future<Address> _generateAndStoreReceivingAddressForIndex(
|
||||
int index,
|
||||
) async {
|
||||
|
||||
Address? address = await getCurrentReceivingAddress();
|
||||
EpicBoxConfigModel epicboxConfig = await getEpicBoxConfig();
|
||||
|
||||
|
@ -325,6 +326,7 @@ class EpiccashWallet extends Bip39Wallet {
|
|||
//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 encodedConfig = jsonEncode(epicboxConfig);
|
||||
if (splitted[1] != epicboxConfig.host) {
|
||||
//Update the address
|
||||
address = await thisWalletAddress(index, epicboxConfig);
|
||||
|
@ -332,6 +334,13 @@ class EpiccashWallet extends Bip39Wallet {
|
|||
} else {
|
||||
address = await thisWalletAddress(index, epicboxConfig);
|
||||
}
|
||||
|
||||
if (info.cachedReceivingAddress != address.value) {
|
||||
await info.updateReceivingAddress(
|
||||
newAddress: address.value,
|
||||
isar: mainDB.isar,
|
||||
);
|
||||
}
|
||||
return address;
|
||||
}
|
||||
|
||||
|
@ -360,7 +369,6 @@ class EpiccashWallet extends Bip39Wallet {
|
|||
subType: AddressSubType.receiving,
|
||||
publicKey: [], // ??
|
||||
);
|
||||
|
||||
await mainDB.updateOrPutAddresses([address]);
|
||||
return address;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue