Skip to content

Commit c87a1a6

Browse files
committed
setup default config as intended
1 parent d522e13 commit c87a1a6

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

routes/web3relay.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ var filterTrace = require('./filters').filterTrace;
1818

1919
/*Start config for node connection and sync*/
2020
var config = {};
21-
// set the default NODE address to localhost if it's not provided
22-
if (!('nodeAddr' in config) || !(config.nodeAddr)) {
23-
config.nodeAddr = 'localhost'; // default
24-
}
25-
// set the default geth port if it's not provided
26-
if (!('gethPort' in config) || (typeof config.gethPort) !== 'number') {
27-
config.gethPort = 8545; // default
28-
}
2921
//Look for config.json file if not
3022
try {
3123
var configContents = fs.readFileSync('config.json');
@@ -41,6 +33,16 @@ catch (error) {
4133
process.exit(1);
4234
}
4335
}
36+
37+
// set the default NODE address to localhost if it's not provided
38+
if (!('nodeAddr' in config) || !(config.nodeAddr)) {
39+
config.nodeAddr = 'localhost'; // default
40+
}
41+
// set the default geth port if it's not provided
42+
if (!('gethPort' in config) || (typeof config.gethPort) !== 'number') {
43+
config.gethPort = 8545; // default
44+
}
45+
4446
//Create Web3 connection
4547
if (typeof web3 !== "undefined") {
4648
web3 = new Web3(web3.currentProvider);

0 commit comments

Comments
 (0)