From 6b9acb8c6bffd46a255517607a2824cad9bf644d Mon Sep 17 00:00:00 2001 From: poma Date: Thu, 1 Oct 2020 07:01:02 +0300 Subject: [PATCH] minor cleanup --- src/server.js | 4 ++-- src/worker.js | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/server.js b/src/server.js index 4b3ef25..5c85ea3 100644 --- a/src/server.js +++ b/src/server.js @@ -34,5 +34,5 @@ app.post('/relay', controller.tornadoWithdraw) // app.post('/v1/miningWithdraw', controller.miningWithdraw) worker.start() -app.listen(port || 8000) -console.log(`Relayer ${version} started on port ${port || 8000}`) +app.listen(port) +console.log(`Relayer ${version} started on port ${port}`) diff --git a/src/worker.js b/src/worker.js index 861b96e..9964d8a 100644 --- a/src/worker.js +++ b/src/worker.js @@ -30,12 +30,9 @@ async function fetchTree() { } async function start() { - web3 = new Web3(rpcUrl, null, { transactionConfirmationBlocks: 1 }) - const account = web3.eth.accounts.privateKeyToAccount('0x' + privateKey) - web3.eth.accounts.wallet.add('0x' + privateKey) - web3.eth.defaultAccount = account.address - updateConfig({ rewardAccount: account.address }) + web3 = new Web3(rpcUrl) txManager = new TxManager({ privateKey, rpcUrl }) + updateConfig({ rewardAccount: txManager.address }) queue.process(process) redisSubscribe.subscribe('treeUpdate', fetchTree) await fetchTree()