Skip to content

Commit

Permalink
Merge pull request bcoin-org#563 from tuxcanfly/fix-config-file
Browse files Browse the repository at this point in the history
multi: pass new Node option `file` to wallet plugin
  • Loading branch information
tuxcanfly authored Aug 13, 2018
2 parents f4bf981 + 7f4494e commit b3fd965
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/node
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (process.argv.indexOf('--version') !== -1
const FullNode = require('../lib/node/fullnode');

const node = new FullNode({
config: true,
file: true,
argv: true,
env: true,
logFile: true,
Expand Down
2 changes: 1 addition & 1 deletion bin/wallet
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (process.argv.indexOf('--version') !== -1
const Node = require('../lib/wallet/node');

const node = new Node({
config: true,
file: true,
argv: true,
env: true,
logFile: true,
Expand Down
2 changes: 1 addition & 1 deletion lib/node/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Node extends EventEmitter {
this.config.inject(options);
this.config.load(options);

if (options.config)
if (options.file || options.config)
this.config.open(config);

this.network = Network.get(this.config.getSuffix());
Expand Down
4 changes: 3 additions & 1 deletion lib/wallet/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class Plugin extends EventEmitter {
super();

this.config = node.config.filter('wallet');
this.config.open('wallet.conf');

if (node.config.options.file)
this.config.open('wallet.conf');

this.network = node.network;
this.logger = node.logger;
Expand Down

0 comments on commit b3fd965

Please sign in to comment.