Browse Source

add extend dependency, use to extend defaults with config in PeerManager instead of overwiting all

patch-2
Gordon Hall 11 years ago
parent
commit
6e8589e9b3
  1. 4
      PeerManager.js
  2. 3
      package.json

4
PeerManager.js

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

3
package.json

@ -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…
Cancel
Save