Warm up wallet refresh after node connect
build / Build Linux wallet (push) Failing after 1m48s
build / Build Windows wallet (push) Has been cancelled

This commit is contained in:
Codex Bot
2026-04-19 21:20:04 +02:00
parent 2ed08223a7
commit c7550386a2
+22
View File
@@ -322,6 +322,7 @@ class MoneroCBackend implements WalletBackend {
peya.Wallet_setTrustedDaemon(_wallet!, arg: trusted);
_ensureStoreTxInfoEnabled();
_startBackgroundSync();
await _warmUpRefresh();
}
@override
@@ -367,6 +368,20 @@ class MoneroCBackend implements WalletBackend {
}
}
Future<void> _warmUpRefresh() async {
_ensureWallet();
if (_rescanInProgress || !_walletInitialized) {
return;
}
final walletAddress = _wallet!.address;
final libPath = peya.libPath;
try {
await Isolate.run(() => _refreshWalletNowJob(walletAddress, libPath));
} catch (error) {
_logger.w('Warm-up refresh failed: $error');
}
}
@override
Future<void> rescanBlockchain({int? fromHeight}) async {
_ensureWallet();
@@ -1160,6 +1175,13 @@ void _refreshJob(int walletAddress, String libPath) {
peya.Coins_refresh(coins);
}
@pragma('vm:entry-point')
void _refreshWalletNowJob(int walletAddress, String libPath) {
peya.libPath = libPath;
final wallet = Pointer<Void>.fromAddress(walletAddress);
peya.Wallet_refresh(wallet);
}
@pragma('vm:entry-point')
Map<String, StakeYieldInfo> _loadActiveStakeYieldsJob(
int walletAddress,