Browse Source

fix PeerManager example

patch-2
Manuel Araoz 11 years ago
parent
commit
84ec7bae4c
  1. 2
      PeerManager.js
  2. 4
      examples/PeerManager.js
  3. 3
      examples/SendTx.js

2
PeerManager.js

@ -25,7 +25,7 @@ function PeerManager(config) {
this.interval = 5000;
this.minConnections = 8;
this.minKnownPeers = 10;
};
}
PeerManager.parent = imports.parent || require('events').EventEmitter;
PeerManager.Connection = Connection;

4
examples/PeerManager.js

@ -26,7 +26,9 @@ var run = function() {
info.conn.sendGetData(invs);
};
var peerman = new PeerManager();
var peerman = new PeerManager({
network: 'testnet'
});
peerman.addPeer(new Peer('127.0.0.1', 18333));

3
examples/SendTx.js

@ -3,13 +3,12 @@
var run = function() {
// Replace '../bitcore' with 'bitcore' if you use this code elsewhere.
var bitcore = require('../bitcore');
var networks = bitcore.networks;
var Peer = bitcore.Peer;
var Transaction = bitcore.Transaction;
var Address = bitcore.Address;
var Script = bitcore.Script;
var coinUtil = bitcore.util;
var PeerManager = require('../PeerManager');
var PeerManager = bitcore.PeerManager;
var createTx = function() {
var TXIN = 'd05f35e0bbc495f6dcab03e599c8f5e32a07cdb4bc76964de201d06a2a7d8265';

Loading…
Cancel
Save