Skip to content

Commit db30ba4

Browse files
committed
refactor: attach Tor listeners lazily in open() instead of constructor
1 parent 61e6a24 commit db30ba4

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/wallets/wallet/intermediate/lib_monero_wallet.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ abstract class LibMoneroWallet<T extends CryptonoteCurrency>
5353
int get isarTransactionVersion => 2;
5454

5555
LibMoneroWallet(super.currency, this.compatType) {
56-
_attachTorListeners();
56+
// Tor listeners are attached lazily in open() so events cannot drive
57+
// updateNode() before a wallet has been loaded.
5758

5859
// Potentially dangerous hack. See comments in _startInit()
5960
_startInit();

lib/wallets/wallet/intermediate/lib_salvium_wallet.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ abstract class LibSalviumWallet<T extends CryptonoteCurrency>
5151
int get isarTransactionVersion => 2;
5252

5353
LibSalviumWallet(super.currency) {
54-
_attachTorListeners();
54+
// Tor listeners are attached lazily in open() so events cannot drive
55+
// updateNode() before a wallet has been loaded.
5556

5657
// Potentially dangerous hack. See comments in _startInit()
5758
_startInit();

lib/wallets/wallet/intermediate/lib_wownero_wallet.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ abstract class LibWowneroWallet<T extends CryptonoteCurrency>
5555
int get isarTransactionVersion => 2;
5656

5757
LibWowneroWallet(super.currency, this.compatType) {
58-
_attachTorListeners();
58+
// Tor listeners are attached lazily in open() so events cannot drive
59+
// updateNode() before a wallet has been loaded.
5960

6061
// Potentially dangerous hack. See comments in _startInit()
6162
_startInit();

0 commit comments

Comments
 (0)