Simplify
This commit is contained in:
parent
2a72f2df9d
commit
316f631e49
1 changed files with 3 additions and 1 deletions
|
|
@ -733,6 +733,8 @@ module.exports = async (
|
||||||
const { walletUnlocker } = LightningServices.services
|
const { walletUnlocker } = LightningServices.services
|
||||||
const { password, alias } = req.body
|
const { password, alias } = req.body
|
||||||
const healthResponse = await checkHealth()
|
const healthResponse = await checkHealth()
|
||||||
|
const isUnlocked = healthResponse.LNDStatus.service !== 'walletUnlocker'
|
||||||
|
|
||||||
if (!alias) {
|
if (!alias) {
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
field: 'alias',
|
field: 'alias',
|
||||||
|
|
@ -755,7 +757,7 @@ module.exports = async (
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (healthResponse.LNDStatus.service !== 'walletUnlocker') {
|
if (isUnlocked) {
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
field: 'wallet',
|
field: 'wallet',
|
||||||
errorMessage: 'Wallet is already unlocked'
|
errorMessage: 'Wallet is already unlocked'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue