mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-22 11:29:23 +00:00
update libepiccash and fix odd address error caused by some odd code
This commit is contained in:
parent
9c9a9f8d3e
commit
db7422a100
2 changed files with 9 additions and 18 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 1d48c0a8aa394324e7c39267e5654038834aff95
|
Subproject commit 0bb1b1ced6e0d3c66e383698f89825754c692986
|
|
@ -299,26 +299,19 @@ class EpiccashWallet extends Bip39Wallet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Only index 0 is currently used in stack wallet.
|
||||||
Future<Address> _generateAndStoreReceivingAddressForIndex(
|
Future<Address> _generateAndStoreReceivingAddressForIndex(
|
||||||
int index,
|
int index,
|
||||||
) async {
|
) 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 (address != null) {
|
if (index != 0) {
|
||||||
final splitted = address.value.split('@');
|
throw Exception("Invalid/unexpected address index used");
|
||||||
//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) {
|
if (info.cachedReceivingAddress != address.value) {
|
||||||
await info.updateReceivingAddress(
|
await info.updateReceivingAddress(
|
||||||
newAddress: address.value,
|
newAddress: address.value,
|
||||||
|
@ -948,8 +941,6 @@ class EpiccashWallet extends Bip39Wallet {
|
||||||
final slatesToCommits = info.epicData?.slatesToCommits ?? {};
|
final slatesToCommits = info.epicData?.slatesToCommits ?? {};
|
||||||
|
|
||||||
for (final tx in transactions) {
|
for (final tx in transactions) {
|
||||||
Logging.instance.log("tx: $tx", level: LogLevel.Info);
|
|
||||||
|
|
||||||
final isIncoming =
|
final isIncoming =
|
||||||
tx.txType == epic_models.TransactionType.TxReceived ||
|
tx.txType == epic_models.TransactionType.TxReceived ||
|
||||||
tx.txType == epic_models.TransactionType.TxReceivedCancelled;
|
tx.txType == epic_models.TransactionType.TxReceivedCancelled;
|
||||||
|
|
Loading…
Reference in a new issue