minor bugfixes
This commit is contained in:
parent
5c9c7aeb5c
commit
aae1db2071
|
@ -11,6 +11,7 @@ function spec() {
|
|||
var networks = require('bitcore/networks');
|
||||
|
||||
var peerdb_fn = 'peerdb.json';
|
||||
|
||||
function PeerSync() {}
|
||||
|
||||
|
||||
|
@ -51,10 +52,6 @@ function spec() {
|
|||
|
||||
PeerSync.prototype.handleInv = function(info) {
|
||||
var invs = info.message.invs;
|
||||
invs.forEach(function(inv) {
|
||||
console.log('[p2p_sync] Handle inv for a ' + CoinConst.MSG.to_str(inv.type));
|
||||
});
|
||||
// TODO: should limit the invs to objects we haven't seen yet
|
||||
info.conn.sendGetData(invs);
|
||||
};
|
||||
|
||||
|
@ -97,7 +94,7 @@ function spec() {
|
|||
PeerSync.prototype.handle_connected = function(data) {
|
||||
var peerman = data.pm;
|
||||
var peers_n = peerman.peers.length;
|
||||
console.log('[p2p_sync] Connected to ' + peers_n + ' peer' + (peers_n !== 1 ? 's': ''));
|
||||
console.log('[p2p_sync] Connected to ' + peers_n + ' peer' + (peers_n !== 1 ? 's' : ''));
|
||||
};
|
||||
|
||||
PeerSync.prototype.run = function() {
|
||||
|
@ -132,4 +129,3 @@ function spec() {
|
|||
|
||||
}
|
||||
module.defineClass(spec);
|
||||
|
||||
|
|
|
@ -257,11 +257,6 @@ function spec() {
|
|||
);
|
||||
};
|
||||
|
||||
Sync.prototype._handleBroadcast = function() {
|
||||
var self = this;
|
||||
console.log('broadcast:' + self.opts.shouldBroadcast);
|
||||
};
|
||||
|
||||
|
||||
Sync.prototype.handleTxForAddress = function(data) {
|
||||
if (this.opts.shouldBroadcast) {
|
||||
|
@ -271,7 +266,7 @@ function spec() {
|
|||
|
||||
Sync.prototype.handleNewTx = function(data) {
|
||||
if (this.opts.shouldBroadcast) {
|
||||
sockets.broadcastTx(data.txid);
|
||||
sockets.broadcastTx(data.tx);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -595,7 +595,7 @@ function spec(b) {
|
|||
});
|
||||
}
|
||||
self.emit('new_tx', {
|
||||
txid: tx.txid
|
||||
tx: tx
|
||||
});
|
||||
|
||||
return cb(err);
|
||||
|
|
Loading…
Reference in New Issue