diff --git a/bin/lamassu-update-wallet-nodes b/bin/lamassu-update-wallet-nodes index 5828b4b6..814aae51 100644 --- a/bin/lamassu-update-wallet-nodes +++ b/bin/lamassu-update-wallet-nodes @@ -29,8 +29,7 @@ function run () { const cryptoPlugin = plugin(crypto) const status = common.es(`sudo supervisorctl status ${crypto.code} | awk '{ print $2 }'`).trim() - if (status === 'RUNNING') cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode), true) - if (status === 'STOPPED') cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode), false) + cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode), _.includes(status, ['RUNNING', 'STARTING'])) }, cryptos) } diff --git a/lib/blockchain/bitcoincash.js b/lib/blockchain/bitcoincash.js index 69da4994..5fbbd4bd 100644 --- a/lib/blockchain/bitcoincash.js +++ b/lib/blockchain/bitcoincash.js @@ -18,7 +18,7 @@ function setup (dataDir) { function updateCore (coinRec, isCurrentlyRunning) { common.logger.info('Updating Bitcoin Cash. This may take a minute...') - if (isCurrentlyRunning) common.es(`sudo supervisorctl stop bitcoincash`) + common.es(`sudo supervisorctl stop bitcoincash`) common.es(`curl -#Lo /tmp/bitcoincash.tar.gz ${coinRec.url}`) common.es(`tar -xzf /tmp/bitcoincash.tar.gz -C /tmp/`) diff --git a/lib/blockchain/dash.js b/lib/blockchain/dash.js index 85fa82c6..f63f39b5 100644 --- a/lib/blockchain/dash.js +++ b/lib/blockchain/dash.js @@ -18,7 +18,7 @@ function setup (dataDir) { function updateCore (coinRec, isCurrentlyRunning) { common.logger.info('Updating Dash Core. This may take a minute...') - if (isCurrentlyRunning) common.es(`sudo supervisorctl stop dash`) + common.es(`sudo supervisorctl stop dash`) common.es(`curl -#Lo /tmp/dash.tar.gz ${coinRec.url}`) common.es(`tar -xzf /tmp/dash.tar.gz -C /tmp/`) diff --git a/lib/blockchain/ethereum.js b/lib/blockchain/ethereum.js index b5bcd342..bdef942a 100644 --- a/lib/blockchain/ethereum.js +++ b/lib/blockchain/ethereum.js @@ -6,7 +6,7 @@ module.exports = { setup, updateCore } function updateCore (coinRec, isCurrentlyRunning) { common.logger.info('Updating the Geth Ethereum wallet. This may take a minute...') - if (isCurrentlyRunning) common.es(`sudo supervisorctl stop ethereum`) + common.es(`sudo supervisorctl stop ethereum`) common.es(`curl -#o /tmp/ethereum.tar.gz ${coinRec.url}`) common.es(`tar -xzf /tmp/ethereum.tar.gz -C /tmp/`) diff --git a/lib/blockchain/litecoin.js b/lib/blockchain/litecoin.js index 5290cbf1..ead1f2f3 100644 --- a/lib/blockchain/litecoin.js +++ b/lib/blockchain/litecoin.js @@ -18,7 +18,7 @@ function setup (dataDir) { function updateCore (coinRec, isCurrentlyRunning) { common.logger.info('Updating Litecoin Core. This may take a minute...') - if (isCurrentlyRunning) common.es(`sudo supervisorctl stop litecoin`) + common.es(`sudo supervisorctl stop litecoin`) common.es(`curl -#o /tmp/litecoin.tar.gz ${coinRec.url}`) common.es(`tar -xzf /tmp/litecoin.tar.gz -C /tmp/`) diff --git a/lib/blockchain/zcash.js b/lib/blockchain/zcash.js index 56364b4f..24fbabea 100644 --- a/lib/blockchain/zcash.js +++ b/lib/blockchain/zcash.js @@ -11,7 +11,7 @@ const logger = common.logger function updateCore (coinRec, isCurrentlyRunning) { common.logger.info('Updating your Zcash wallet. This may take a minute...') - if (isCurrentlyRunning) common.es(`sudo supervisorctl stop zcash`) + common.es(`sudo supervisorctl stop zcash`) common.es(`curl -#Lo /tmp/zcash.tar.gz ${coinRec.url}`) common.es(`tar -xzf /tmp/zcash.tar.gz -C /tmp/`)