work towards connection error

This commit is contained in:
Manuel Araoz 2014-06-02 15:14:28 -03:00
parent c65e677f2c
commit 7b2f227bcc
3 changed files with 3 additions and 14 deletions

View File

@ -63,9 +63,7 @@ Wallet.prototype.seedCopayer = function(pubKey) {
Wallet.prototype.connectToAll = function() {
console.log('[Wallet.js.57]'); //TODO
var all = this.publicKeyRing.getAllCopayerIds();
console.log('[Wallet.js.58] connecting'); //TODO
this.network.connectToCopayers(all);
if (this.seededCopayerId) {
@ -224,8 +222,8 @@ Wallet.prototype.netStart = function() {
self.log('[Wallet.js.132:openError:] GOT openError'); //TODO
self.emit('openError');
});
net.on('error', function(){
self.emit('connectionError'); // Bubble the error
net.on('error', function() {
self.emit('connectionError');
});
net.on('close', function() {
self.emit('close');

View File

@ -269,7 +269,6 @@ Network.prototype._setupPeerHandlers = function(openCallback) {
self._checkAnyPeer();
});
p.on('connection', function(dataConn) {
console.log('### NEW INBOUND CONNECTION %d/%d', self.connectedPeers.length, self.maxPeers);
if (self.connectedPeers.length >= self.maxPeers) {

View File

@ -62,35 +62,29 @@ angular.module('copay.controllerUtils')
$rootScope.wallet = w;
$location.path('addresses');
video.setOwnPeer(myPeerID, w, handlePeerVideo);
console.log('# Done ready handler');
});
w.on('publicKeyRingUpdated', function(dontDigest) {
console.log('[start publicKeyRing handler]'); //TODO
root.setSocketHandlers();
root.updateAddressList();
if (!dontDigest) {
console.log('[pkr digest]');
$rootScope.$digest();
console.log('[done digest]');
}
});
w.on('txProposalsUpdated', function(dontDigest) {
root.updateTxs({onlyPending:true});
root.updateBalance(function(){
if (!dontDigest) {
console.log('[txp digest]');
$rootScope.$digest();
console.log('[done digest]');
}
});
});
w.on('openError', root.onErrorDigest);
w.on('connectionError', root.onErrorDigest);
w.on('connect', function(peerID) {
if (peerID) {
video.callPeer(peerID, handlePeerVideo);
}
console.log('[digest]');
$rootScope.$digest();
});
w.on('disconnect', function(peerID) {
@ -129,7 +123,6 @@ angular.module('copay.controllerUtils')
$rootScope.availableBalance = safeBalance;
root.updateAddressList();
$rootScope.updatingBalance = false;
console.log('Done updating balance.'); //TODO
return cb?cb():null;
});
};
@ -145,7 +138,6 @@ angular.module('copay.controllerUtils')
var inT = w.getTxProposals().sort(function(t1, t2) { return t1.createdTs < t2.createdTs });
var txs = [];
console.log('[START LOOP]'); //TODO
inT.forEach(function(i, index){
if (opts.skip && (index < opts.skip[0] || index >= opts.skip[1])) {
return txs.push(null);