mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
fix: use async api to checkNodeHealth (#2421)
This commit is contained in:
@@ -175,7 +175,10 @@ int getNodeHeightSync() {
|
||||
return cachedNodeHeight;
|
||||
}
|
||||
|
||||
bool isConnectedSync() => currentWallet?.connected() != 0;
|
||||
Future<bool> isConnected() async {
|
||||
final wptrAddress = currentWallet!.ffiAddress();
|
||||
return await Isolate.run(() => monero.Wallet_connected(Pointer.fromAddress(wptrAddress))) == 1;
|
||||
}
|
||||
|
||||
Future<bool> setupNodeSync(
|
||||
{required String address,
|
||||
@@ -396,8 +399,6 @@ void startRefresh() => startRefreshSync();
|
||||
|
||||
Future<void> store() async => _storeSync(0);
|
||||
|
||||
Future<bool> isConnected() async => isConnectedSync();
|
||||
|
||||
Future<int> getNodeHeight() async => getNodeHeightSync();
|
||||
|
||||
void rescanBlockchainAsync() => currentWallet!.rescanBlockchainAsync();
|
||||
|
||||
@@ -188,7 +188,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
|
||||
Future<bool> checkNodeHealth() async {
|
||||
try {
|
||||
// Check if the wallet is currently connected to the daemon
|
||||
final isConnected = monero_wallet.isConnectedSync();
|
||||
final isConnected = await monero_wallet.isConnected();
|
||||
|
||||
if (!isConnected) {
|
||||
return false; // It's not connected to daemon
|
||||
|
||||
Reference in New Issue
Block a user