From 46a6d391cd47723aa580e2339d76e8a556bbc6e4 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 8 Jul 2018 20:43:41 +0300 Subject: [PATCH] simplify use of callback --- lib/modules/ipfs/index.js | 7 +------ lib/modules/swarm/index.js | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/modules/ipfs/index.js b/lib/modules/ipfs/index.js index 76a8f51c..b7e0d0a5 100644 --- a/lib/modules/ipfs/index.js +++ b/lib/modules/ipfs/index.js @@ -136,12 +136,7 @@ class IPFS { blockchainConfig: self.blockchainConfig }); self.logger.trace(`Storage module: Launching ipfs process...`); - return storageProcessesLauncher.launchProcess('ipfs', (err) => { - if (err) { - return callback(err); - } - callback(); - }); + return storageProcessesLauncher.launchProcess('ipfs', callback); } registerUploadCommand() { diff --git a/lib/modules/swarm/index.js b/lib/modules/swarm/index.js index 1de8c023..135f9ded 100644 --- a/lib/modules/swarm/index.js +++ b/lib/modules/swarm/index.js @@ -105,12 +105,7 @@ class Swarm { blockchainConfig: self.blockchainConfig }); self.logger.trace(`Storage module: Launching swarm process...`); - return storageProcessesLauncher.launchProcess('swarm', (err) => { - if (err) { - return callback(err); - } - callback(); - }); + return storageProcessesLauncher.launchProcess('swarm', callback); } registerUploadCommand(cb) {