From aae795402049fbe49511a17cd98e7abae0455fbb Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Wed, 19 Sep 2018 20:11:36 -0500 Subject: [PATCH] await proxy just before createFundAndUnlockAccounts --- lib/modules/blockchain_process/blockchain.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/modules/blockchain_process/blockchain.js b/lib/modules/blockchain_process/blockchain.js index 4cb42eaad..50fe067f7 100644 --- a/lib/modules/blockchain_process/blockchain.js +++ b/lib/modules/blockchain_process/blockchain.js @@ -153,13 +153,10 @@ Blockchain.prototype.run = function() { }, function getMainCommand(next) { self.client.mainCommand(address, function(cmd, args) { - if (self.config.proxy) { - self.setupProxy(); - } next(null, cmd, args); }, true); } - ], function (err, cmd, args) { + ], async function (err, cmd, args) { if (err) { console.error(err.message); return; @@ -182,10 +179,13 @@ Blockchain.prototype.run = function() { console.error(`Geth error: ${data}`); }); // Geth logs appear in stderr somehow - self.child.stderr.on('data', (data) => { + self.child.stderr.on('data', async (data) => { data = data.toString(); if (!self.readyCalled && data.indexOf('WebSocket endpoint opened') > -1) { if (self.isDev) { + if (self.config.proxy) { + await self.setupProxy(); + } self.createFundAndUnlockAccounts((err) => { // TODO: this is never called! if(err) console.error('Error creating, unlocking, and funding accounts', err);