fix walletOpen status always returning true

This commit is contained in:
2026-05-17 10:48:35 +08:00
parent e6ed6445ad
commit 23b7447b92
2 changed files with 15 additions and 3 deletions
+12 -1
View File
@@ -218,11 +218,22 @@ export class MoneroWalletManager {
}
}
async isConnected(): Promise<boolean> {
async isWalletOpen(): Promise<boolean> {
if (!this.wallet) return false
try {
await this.wallet.getHeight()
return true
} catch {
return false
}
}
async isConnected(): Promise<boolean> {
if (!this.wallet) return false
try {
const daemon = await connectToDaemonRpc(`http://${this.daemonAddress}`)
await daemon.getHeight()
return true
} catch (e) {
console.log(`[monero] connection check failed:`, e)
return false