fix walletOpen status always returning true
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user