mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
fix: make setupBackgroundSync run in background
This commit is contained in:
parent
151da9a134
commit
344f7d2610
1 changed files with 11 additions and 2 deletions
|
@ -418,11 +418,20 @@ Future<void> loadWallet(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupBackgroundSync(String password, Wallet2Wallet wallet) {
|
Future<void> setupBackgroundSync(String password, Wallet2Wallet wallet) async {
|
||||||
if (isViewOnlyBySpendKey(wallet)) {
|
if (isViewOnlyBySpendKey(wallet)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wallet.setupBackgroundSync(backgroundSyncType: 2, walletPassword: password, backgroundCachePassword: '');
|
final wptrAddr = wallet.ffiAddress();
|
||||||
|
await Isolate.run(() {
|
||||||
|
monero.Wallet_setupBackgroundSync(
|
||||||
|
Pointer.fromAddress(wptrAddr),
|
||||||
|
backgroundSyncType: 2,
|
||||||
|
walletPassword: password,
|
||||||
|
backgroundCachePassword: '',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
// wallet.setupBackgroundSync(backgroundSyncType: 2, walletPassword: password, backgroundCachePassword: '');
|
||||||
if (wallet.status() != 0) {
|
if (wallet.status() != 0) {
|
||||||
// We simply ignore the error.
|
// We simply ignore the error.
|
||||||
printV("setupBackgroundSync: ${wallet.errorString()}");
|
printV("setupBackgroundSync: ${wallet.errorString()}");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue