Skip to content

Commit

Permalink
Merge pull request #74 from maraoz/fix/testnet-peer
Browse files Browse the repository at this point in the history
fix PeerSync for testnet
  • Loading branch information
matiu committed May 13, 2014
2 parents 77a4f29 + 19c2b10 commit 5cf6ce4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ else {
p2p_port = '18333';
}


switch(process.env.NODE_ENV) {
case 'production':
env += '';
Expand Down
9 changes: 5 additions & 4 deletions lib/PeerSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var bitcore = require('bitcore');
var bitcoreUtil = bitcore.util;
var Sync = require('./Sync');
var Peer = bitcore.Peer;
var PeerManager = bitcore.PeerManager;
var config = require('../config/config');
var networks = bitcore.networks;
var sockets = require('../app/controllers/socket.js');
Expand All @@ -16,10 +17,10 @@ function PeerSync(opts) {
this.connected = false;
this.peerdb = undefined;
this.allowReorgs = false;
this.PeerManager = require('soop').load('../node_modules/bitcore/lib/PeerManager',{
network: (config.network === 'testnet' ? networks.testnet : networks.livenet)
});
this.peerman = new this.PeerManager();
var pmConfig = {
network: config.network
};
this.peerman = new PeerManager(pmConfig);
this.load_peers();
this.sync = new Sync(opts);
}
Expand Down

0 comments on commit 5cf6ce4

Please sign in to comment.