node: require walletdb by default for now.
This commit is contained in:
parent
74b21b78c5
commit
1d6bd6dbe4
5
bin/node
5
bin/node
@ -5,6 +5,7 @@
|
||||
process.title = 'bcoin';
|
||||
|
||||
var bcoin = require('../');
|
||||
var plugin = require('../lib/wallet/plugin');
|
||||
var co = bcoin.co;
|
||||
var node;
|
||||
|
||||
@ -21,6 +22,10 @@ node = new bcoin.fullnode({
|
||||
loader: require
|
||||
});
|
||||
|
||||
// Temporary hack
|
||||
if (!node.has('walletdb'))
|
||||
node.use(plugin);
|
||||
|
||||
node.on('error', function(err) {
|
||||
;
|
||||
});
|
||||
|
||||
@ -6,6 +6,7 @@ process.title = 'bcoin';
|
||||
|
||||
var assert = require('assert');
|
||||
var bcoin = require('../');
|
||||
var plugin = require('../lib/wallet/plugin');
|
||||
var util = bcoin.util;
|
||||
var co = bcoin.co;
|
||||
var node;
|
||||
@ -23,6 +24,10 @@ node = bcoin.spvnode({
|
||||
loader: require
|
||||
});
|
||||
|
||||
// Temporary hack
|
||||
if (!node.has('walletdb'))
|
||||
node.use(plugin);
|
||||
|
||||
node.on('error', function(err) {
|
||||
;
|
||||
});
|
||||
|
||||
@ -314,6 +314,16 @@ Node.prototype.use = function use(plugin) {
|
||||
return instance;
|
||||
};
|
||||
|
||||
/**
|
||||
* Test whether a plugin is available.
|
||||
* @param {String} name
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
|
||||
Node.prototype.has = function has(name) {
|
||||
return this.plugins[name] != null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Require a plugin.
|
||||
* @param {String} name
|
||||
@ -371,10 +381,6 @@ Node.prototype.loadPlugins = function loadPlugins() {
|
||||
assert(typeof name === 'string',
|
||||
'Plugin name must be a string.');
|
||||
|
||||
// Temporary until we separate walletdb out.
|
||||
if (name === 'walletdb')
|
||||
name = __dirname + '/../wallet/plugin';
|
||||
|
||||
plugin = loader(name);
|
||||
|
||||
this.use(plugin);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user