mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
do not check addresses until refresh initiated
This commit is contained in:
parent
5c7cc9932d
commit
197a2a1f19
10 changed files with 27 additions and 39 deletions
|
@ -1267,7 +1267,7 @@ class BitcoinWallet extends CoinServiceAPI
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> initializeExisting() async {
|
Future<void> initializeExisting() async {
|
||||||
Logging.instance.log("Opening existing ${coin.prettyName} wallet.",
|
Logging.instance.log("initializeExisting() ${coin.prettyName} wallet.",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
|
||||||
if (getCachedId() == null) {
|
if (getCachedId() == null) {
|
||||||
|
@ -1276,8 +1276,8 @@ class BitcoinWallet extends CoinServiceAPI
|
||||||
}
|
}
|
||||||
|
|
||||||
await _prefs.init();
|
await _prefs.init();
|
||||||
await _checkCurrentChangeAddressesForTransactions();
|
// await _checkCurrentChangeAddressesForTransactions();
|
||||||
await _checkCurrentReceivingAddressesForTransactions();
|
// await _checkCurrentReceivingAddressesForTransactions();
|
||||||
}
|
}
|
||||||
|
|
||||||
// hack to add tx to txData before refresh completes
|
// hack to add tx to txData before refresh completes
|
||||||
|
|
|
@ -1195,7 +1195,7 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> initializeExisting() async {
|
Future<void> initializeExisting() async {
|
||||||
Logging.instance.log("Opening existing ${coin.prettyName} wallet.",
|
Logging.instance.log("initializeExisting() ${coin.prettyName} wallet.",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
|
||||||
if (getCachedId() == null) {
|
if (getCachedId() == null) {
|
||||||
|
@ -1204,8 +1204,8 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
}
|
}
|
||||||
|
|
||||||
await _prefs.init();
|
await _prefs.init();
|
||||||
await _checkCurrentChangeAddressesForTransactions();
|
// await _checkCurrentChangeAddressesForTransactions();
|
||||||
await _checkCurrentReceivingAddressesForTransactions();
|
// await _checkCurrentReceivingAddressesForTransactions();
|
||||||
}
|
}
|
||||||
|
|
||||||
// hack to add tx to txData before refresh completes
|
// hack to add tx to txData before refresh completes
|
||||||
|
|
|
@ -1062,7 +1062,7 @@ class DogecoinWallet extends CoinServiceAPI
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> initializeExisting() async {
|
Future<void> initializeExisting() async {
|
||||||
Logging.instance.log("Opening existing ${coin.prettyName} wallet.",
|
Logging.instance.log("initializeExisting() ${coin.prettyName} wallet.",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
|
||||||
if (getCachedId() == null) {
|
if (getCachedId() == null) {
|
||||||
|
@ -1071,8 +1071,8 @@ class DogecoinWallet extends CoinServiceAPI
|
||||||
}
|
}
|
||||||
|
|
||||||
await _prefs.init();
|
await _prefs.init();
|
||||||
await _checkCurrentChangeAddressesForTransactions();
|
// await _checkCurrentChangeAddressesForTransactions();
|
||||||
await _checkCurrentReceivingAddressesForTransactions();
|
// await _checkCurrentReceivingAddressesForTransactions();
|
||||||
}
|
}
|
||||||
|
|
||||||
// hack to add tx to txData before refresh completes
|
// hack to add tx to txData before refresh completes
|
||||||
|
|
|
@ -981,7 +981,7 @@ class EpicCashWallet extends CoinServiceAPI
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> initializeExisting() async {
|
Future<void> initializeExisting() async {
|
||||||
Logging.instance.log("Opening existing ${coin.prettyName} wallet",
|
Logging.instance.log("initializeExisting() ${coin.prettyName} wallet",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
|
||||||
final config = await getRealConfig();
|
final config = await getRealConfig();
|
||||||
|
|
|
@ -1856,7 +1856,7 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
||||||
@override
|
@override
|
||||||
Future<void> initializeExisting() async {
|
Future<void> initializeExisting() async {
|
||||||
Logging.instance.log(
|
Logging.instance.log(
|
||||||
"Opening existing $_walletId ${coin.prettyName} wallet.",
|
"initializeExisting() $_walletId ${coin.prettyName} wallet.",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
|
||||||
if (getCachedId() == null) {
|
if (getCachedId() == null) {
|
||||||
|
@ -1864,8 +1864,8 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
||||||
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
||||||
}
|
}
|
||||||
await _prefs.init();
|
await _prefs.init();
|
||||||
await checkChangeAddressForTransactions();
|
// await checkChangeAddressForTransactions();
|
||||||
await checkReceivingAddressForTransactions();
|
// await checkReceivingAddressForTransactions();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> refreshIfThereIsNewData() async {
|
Future<bool> refreshIfThereIsNewData() async {
|
||||||
|
|
|
@ -1191,7 +1191,7 @@ class LitecoinWallet extends CoinServiceAPI
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> initializeExisting() async {
|
Future<void> initializeExisting() async {
|
||||||
Logging.instance.log("Opening existing ${coin.prettyName} wallet.",
|
Logging.instance.log("initializeExisting() ${coin.prettyName} wallet.",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
|
||||||
if (getCachedId() == null) {
|
if (getCachedId() == null) {
|
||||||
|
@ -1199,8 +1199,8 @@ class LitecoinWallet extends CoinServiceAPI
|
||||||
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
||||||
}
|
}
|
||||||
await _prefs.init();
|
await _prefs.init();
|
||||||
await _checkCurrentChangeAddressesForTransactions();
|
// await _checkCurrentChangeAddressesForTransactions();
|
||||||
await _checkCurrentReceivingAddressesForTransactions();
|
// await _checkCurrentReceivingAddressesForTransactions();
|
||||||
}
|
}
|
||||||
|
|
||||||
// hack to add tx to txData before refresh completes
|
// hack to add tx to txData before refresh completes
|
||||||
|
|
|
@ -258,7 +258,7 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
@override
|
@override
|
||||||
Future<void> initializeExisting() async {
|
Future<void> initializeExisting() async {
|
||||||
Logging.instance.log(
|
Logging.instance.log(
|
||||||
"Opening existing ${coin.prettyName} wallet $walletName...",
|
"initializeExisting() ${coin.prettyName} wallet $walletName...",
|
||||||
level: LogLevel.Info,
|
level: LogLevel.Info,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -289,24 +289,12 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
walletBase = (await walletService!.openWallet(_walletId, password))
|
walletBase = (await walletService!.openWallet(_walletId, password))
|
||||||
as MoneroWalletBase;
|
as MoneroWalletBase;
|
||||||
|
|
||||||
await _checkCurrentReceivingAddressesForTransactions();
|
// await _checkCurrentReceivingAddressesForTransactions();
|
||||||
// walletBase!.onNewBlock = onNewBlock;
|
|
||||||
// walletBase!.onNewTransaction = onNewTransaction;
|
|
||||||
// walletBase!.syncStatusChanged = syncStatusChanged;
|
|
||||||
Logging.instance.log(
|
Logging.instance.log(
|
||||||
"Opened existing ${coin.prettyName} wallet $walletName",
|
"Opened existing ${coin.prettyName} wallet $walletName",
|
||||||
level: LogLevel.Info,
|
level: LogLevel.Info,
|
||||||
);
|
);
|
||||||
// Wallet already exists, triggers for a returning user
|
|
||||||
|
|
||||||
// String indexKey = "receivingIndex";
|
|
||||||
// final curIndex =
|
|
||||||
// await DB.instance.get<dynamic>(boxName: walletId, key: indexKey) as int;
|
|
||||||
// // Use new index to derive a new receiving address
|
|
||||||
// final newReceivingAddress = await _generateAddressForChain(0, curIndex);
|
|
||||||
// Logging.instance.log("xmr address in init existing: $newReceivingAddress",
|
|
||||||
// level: LogLevel.Info);
|
|
||||||
// _currentReceivingAddress = Future(() => newReceivingAddress);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -1181,7 +1181,7 @@ class NamecoinWallet extends CoinServiceAPI
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> initializeExisting() async {
|
Future<void> initializeExisting() async {
|
||||||
Logging.instance.log("Opening existing ${coin.prettyName} wallet.",
|
Logging.instance.log("initializeExisting() ${coin.prettyName} wallet.",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
|
||||||
if (getCachedId() == null) {
|
if (getCachedId() == null) {
|
||||||
|
@ -1189,8 +1189,8 @@ class NamecoinWallet extends CoinServiceAPI
|
||||||
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
||||||
}
|
}
|
||||||
await _prefs.init();
|
await _prefs.init();
|
||||||
await _checkCurrentChangeAddressesForTransactions();
|
// await _checkCurrentChangeAddressesForTransactions();
|
||||||
await _checkCurrentReceivingAddressesForTransactions();
|
// await _checkCurrentReceivingAddressesForTransactions();
|
||||||
}
|
}
|
||||||
|
|
||||||
// hack to add tx to txData before refresh completes
|
// hack to add tx to txData before refresh completes
|
||||||
|
|
|
@ -1107,7 +1107,7 @@ class ParticlWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> initializeExisting() async {
|
Future<void> initializeExisting() async {
|
||||||
Logging.instance.log("Opening existing ${coin.prettyName} wallet.",
|
Logging.instance.log("initializeExisting() ${coin.prettyName} wallet.",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
|
||||||
if (getCachedId() == null) {
|
if (getCachedId() == null) {
|
||||||
|
@ -1115,8 +1115,8 @@ class ParticlWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
||||||
}
|
}
|
||||||
await _prefs.init();
|
await _prefs.init();
|
||||||
await _checkCurrentChangeAddressesForTransactions();
|
// await _checkCurrentChangeAddressesForTransactions();
|
||||||
await _checkCurrentReceivingAddressesForTransactions();
|
// await _checkCurrentReceivingAddressesForTransactions();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO make sure this copied implementation from bitcoin_wallet.dart applies for particl just as well--or import it
|
// TODO make sure this copied implementation from bitcoin_wallet.dart applies for particl just as well--or import it
|
||||||
|
|
|
@ -281,7 +281,7 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
@override
|
@override
|
||||||
Future<void> initializeExisting() async {
|
Future<void> initializeExisting() async {
|
||||||
Logging.instance.log(
|
Logging.instance.log(
|
||||||
"Opening existing ${coin.prettyName} wallet $walletName...",
|
"initializeExisting() ${coin.prettyName} wallet $walletName...",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
|
||||||
if (getCachedId() == null) {
|
if (getCachedId() == null) {
|
||||||
|
@ -306,7 +306,7 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
walletBase = (await walletService?.openWallet(_walletId, password!))
|
walletBase = (await walletService?.openWallet(_walletId, password!))
|
||||||
as WowneroWalletBase;
|
as WowneroWalletBase;
|
||||||
|
|
||||||
await _checkCurrentReceivingAddressesForTransactions();
|
// await _checkCurrentReceivingAddressesForTransactions();
|
||||||
|
|
||||||
Logging.instance.log(
|
Logging.instance.log(
|
||||||
"Opened existing ${coin.prettyName} wallet $walletName",
|
"Opened existing ${coin.prettyName} wallet $walletName",
|
||||||
|
|
Loading…
Reference in a new issue