multi: pass new Node option file to wallet plugin

`file` is similar to `config`, but it propogates to the wallet plugin
and loads the wallet config file only if set to true.

This is useful to disable config files for both node and wallet when
running a full node, for example in a test environment.
This commit is contained in:
Javed Khan 2018-08-09 13:09:54 +05:30
parent f4bf9816a5
commit 7f4494e278
No known key found for this signature in database
GPG Key ID: 7E31745B904584E6
4 changed files with 6 additions and 4 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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());

View File

@ -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;