diff --git a/src/routes/v3/full-node/control.js b/src/routes/v3/full-node/control.js index 310da58..3bd6df1 100644 --- a/src/routes/v3/full-node/control.js +++ b/src/routes/v3/full-node/control.js @@ -20,12 +20,13 @@ let _this class Control { constructor () { _this = this - this.axios = axios - this.routeUtils = routeUtils - this.router = router - this.router.get('/', this.root) - this.router.get('/getNetworkInfo', this.getNetworkInfo) + _this.axios = axios + _this.routeUtils = routeUtils + + _this.router = router + _this.router.get('/', _this.root) + _this.router.get('/getNetworkInfo', _this.getNetworkInfo) } root (req, res, next) { @@ -65,7 +66,7 @@ class Control { try { // const response = await BitboxHTTP(requestConfig) - const response = await this.axios.request(options) + const response = await _this.axios.request(options) return res.json(response.data.result) } catch (error) { diff --git a/src/routes/v3/full-node/mining.js b/src/routes/v3/full-node/mining.js index 89461c7..b8346bf 100644 --- a/src/routes/v3/full-node/mining.js +++ b/src/routes/v3/full-node/mining.js @@ -18,13 +18,14 @@ let _this class Mining { constructor () { _this = this - this.axios = axios - this.routeUtils = routeUtils - this.router = router - this.router.get('/', this.root) - this.router.get('/getMiningInfo', this.getMiningInfo) - this.router.get('/getNetworkHashPS', this.getNetworkHashPS) + _this.axios = axios + _this.routeUtils = routeUtils + + _this.router = router + _this.router.get('/', _this.root) + _this.router.get('/getMiningInfo', _this.getMiningInfo) + _this.router.get('/getNetworkHashPS', _this.getNetworkHashPS) } root (req, res, next) { @@ -124,7 +125,7 @@ class Mining { options.data.method = 'getnetworkhashps' options.data.params = [nblocks, height] - const response = await this.axios.request(options) + const response = await _this.axios.request(options) return res.json(response.data.result) } catch (err) {