mirror of https://github.com/BTCPrivate/copay.git
clean logs and remove unnecesary code
This commit is contained in:
parent
97882f8e3b
commit
96c8867762
|
@ -202,12 +202,12 @@ Network.prototype._onMessage = function(enc) {
|
|||
this._deletePeer(sender);
|
||||
return;
|
||||
}
|
||||
log.debug('Async: receiving ' + JSON.stringify(payload));
|
||||
|
||||
if (this.ignoreMessageFromTs && this.ignoreMessageFromTs === enc.ts) {
|
||||
log.debug('Ignoring message from ', enc.ts);
|
||||
log.debug('Ignoring trailing message. Ts:', enc.ts);
|
||||
return;
|
||||
}
|
||||
log.debug('Async: receiving ' + JSON.stringify(payload));
|
||||
|
||||
var self = this;
|
||||
switch (payload.type) {
|
||||
|
@ -352,7 +352,7 @@ Network.prototype.start = function(opts, openCallback) {
|
|||
};
|
||||
|
||||
Network.prototype.createSocket = function() {
|
||||
log.debug('Async: Connecting to socket:', this.url, this.socketOptions);
|
||||
log.debug('Async: Connecting to socket:', this.url);
|
||||
return io.connect(this.url, this.socketOptions);
|
||||
};
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ Identity.prototype.retrieveWalletFromStorage = function(walletId, opts, callback
|
|||
return callback(error);
|
||||
}
|
||||
try {
|
||||
log.debug('## OPENING Wallet: ' + walletId);
|
||||
log.debug('## OPENING Wallet:', self.getName(), walletId);
|
||||
if (_.isString(walletData)) {
|
||||
walletData = JSON.parse(walletData);
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ Identity.prototype.bindWallet = function(w) {
|
|||
var self = this;
|
||||
|
||||
self.wallets[w.getId()] = w;
|
||||
log.debug('Binding wallet ' + w.getName());
|
||||
log.debug('Binding wallet:' + w.getName());
|
||||
|
||||
w.on('txProposalsUpdated', function() {
|
||||
Identity.storeWalletDebounced(self, w);
|
||||
|
|
|
@ -124,7 +124,7 @@ Insight.prototype.subscribeToBlocks = function() {
|
|||
|
||||
/** @private */
|
||||
Insight.prototype._getSocketIO = function(url, opts) {
|
||||
log.debug('Insight: Connecting to socket:', this.url, this.opts);
|
||||
log.debug('Insight: Connecting to socket:', this.url);
|
||||
return io(this.url, this.opts);
|
||||
};
|
||||
|
||||
|
@ -200,7 +200,6 @@ Insight.prototype.subscribe = function(addresses) {
|
|||
var self = this;
|
||||
|
||||
function handlerFor(self, address) {
|
||||
console.log('HANDLER [Insight.js.150:address:]',address); //TODO
|
||||
return function(txid) {
|
||||
// verify the address is still subscribed
|
||||
if (!self.subscribed[address]) return;
|
||||
|
|
|
@ -116,7 +116,8 @@ function Wallet(opts) {
|
|||
inherits(Wallet, events.EventEmitter);
|
||||
|
||||
Wallet.prototype.emitAndKeepAlive = function(args) {
|
||||
log.debug('Wallet Emitting:', arguments);
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
log.debug('Wallet Emitting:', args);
|
||||
this.keepAlive();
|
||||
this.emit.apply(this, arguments);
|
||||
};
|
||||
|
@ -810,7 +811,7 @@ Wallet.prototype._setBlockchainListeners = function() {
|
|||
var self = this;
|
||||
self.blockchain.removeAllListeners();
|
||||
|
||||
log.debug('Setting Blockchain listeners for', this.getId());
|
||||
log.debug('Setting Blockchain listeners for', this.getName());
|
||||
self.blockchain.on('reconnect', function(attempts) {
|
||||
log.debug('Wallet:' + self.id + 'blockchain reconnect event');
|
||||
self.emitAndKeepAlive('insightReconnected');
|
||||
|
@ -888,12 +889,8 @@ Wallet.prototype.netStart = function() {
|
|||
|
||||
log.debug('Wallet:' + self.id + ' Starting networking: ' + startOpts.copayerId);
|
||||
net.start(startOpts, function() {
|
||||
log.debug('Wallet:' + self.id + ' Networking ready:', net.copayerId);
|
||||
self._setBlockchainListeners();
|
||||
self.emitAndKeepAlive('ready', net.getPeer());
|
||||
setTimeout(function() {
|
||||
self._newAddresses(true);
|
||||
}, 0);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue