add extend dependency, use to extend defaults with config in PeerManager instead of overwiting all
This commit is contained in:
parent
9f278cf848
commit
6e8589e9b3
|
@ -1,5 +1,6 @@
|
|||
|
||||
var imports = require('soop').imports();
|
||||
var extend = imports.extend || require('extend');
|
||||
var log = imports.log || require('./util/log');
|
||||
var bitcoreDefaults = imports.config || require('./config');
|
||||
var Connection = imports.Connection || require ('./Connection');
|
||||
|
@ -12,7 +13,8 @@ GetAdjustedTime = imports.GetAdjustedTime || function () {
|
|||
};
|
||||
|
||||
function PeerManager(config) {
|
||||
this.config = config || bitcoreDefaults;
|
||||
// extend defaults with config
|
||||
this.config = extend(true, config || {}, bitcoreDefaults);
|
||||
this.active = false;
|
||||
this.timer = null;
|
||||
|
||||
|
|
|
@ -70,7 +70,8 @@
|
|||
"socks5-client": "~0.3.6",
|
||||
"brfs": "=1.0.0",
|
||||
"chai": "=1.9.1",
|
||||
"uglifyify": "=1.2.3"
|
||||
"uglifyify": "=1.2.3",
|
||||
"extend": "~1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt-contrib-watch": "~0.5.3",
|
||||
|
|
Loading…
Reference in New Issue