From 316f631e4974ef3e75f1781d252bde3fb2412909 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Mon, 27 Dec 2021 15:26:48 -0400 Subject: [PATCH] Simplify --- src/routes.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes.js b/src/routes.js index 9fba152e..68f7f7bc 100644 --- a/src/routes.js +++ b/src/routes.js @@ -733,6 +733,8 @@ module.exports = async ( const { walletUnlocker } = LightningServices.services const { password, alias } = req.body const healthResponse = await checkHealth() + const isUnlocked = healthResponse.LNDStatus.service !== 'walletUnlocker' + if (!alias) { return res.status(400).json({ field: 'alias', @@ -755,7 +757,7 @@ module.exports = async ( }) } - if (healthResponse.LNDStatus.service !== 'walletUnlocker') { + if (isUnlocked) { return res.status(400).json({ field: 'wallet', errorMessage: 'Wallet is already unlocked'