From cae11776acd32b35a549386c53600ebee5d28468 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Wed, 13 Aug 2014 17:27:33 -0400 Subject: [PATCH] trying to get past intermediate screen --- js/models/core/PublicKeyRing.js | 1 + js/models/core/Wallet.js | 7 +++++-- js/models/network/Async.js | 9 ++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/js/models/core/PublicKeyRing.js b/js/models/core/PublicKeyRing.js index b86f18277..360ebd491 100644 --- a/js/models/core/PublicKeyRing.js +++ b/js/models/core/PublicKeyRing.js @@ -377,6 +377,7 @@ PublicKeyRing.prototype._checkInPKR = function(inPKR, ignoreId) { PublicKeyRing.prototype._mergePubkeys = function(inPKR) { + alert('merge pubkeys'); var self = this; var hasChanged = false; diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index d86999b59..ffbb245a7 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -318,15 +318,19 @@ Wallet.prototype._handleAddressBook = function(senderId, data, isInbound) { Wallet.prototype._handleData = function(senderId, data, isInbound) { + + alert(JSON.stringify(data)); if (data.type !== 'walletId' && this.id !== data.walletId) { this.emit('badMessage', senderId); this.log('badMessage FROM:', senderId); + alert('fuck'); return; } switch (data.type) { // This handler is repeaded on WalletFactory (#join). TODO case 'walletId': + alert('walletID received'); this.sendWalletReady(senderId); break; case 'walletReady': @@ -356,7 +360,6 @@ Wallet.prototype._handleData = function(senderId, data, isInbound) { }; Wallet.prototype._handleConnect = function(newCopayerId) { - alert(newCopayerId); if (newCopayerId) { this.log('#### Setting new COPAYER:', newCopayerId); this.sendWalletId(newCopayerId); @@ -1727,7 +1730,7 @@ Wallet.prototype.indexDiscovery = function(start, change, copayerIndex, gap, cb) function _while() { return hasActivity; }, - function _finnaly(err) { + function _finally(err) { if (err) return cb(err); cb(null, lastActive); } diff --git a/js/models/network/Async.js b/js/models/network/Async.js index ba852a0cc..9f6559eaf 100644 --- a/js/models/network/Async.js +++ b/js/models/network/Async.js @@ -199,14 +199,11 @@ Network.prototype._onMessage = function(enc) { return; } - if (this.allowedCopayerIds && !this.allowedCopayerIds[payload.copayerId]) { this._deletePeer(sender); return; } - - // TODO /* if (!this.copayerForPeer[sender] || (isInbound && !this.isInboundPeerAuth[sender])) { @@ -215,6 +212,9 @@ Network.prototype._onMessage = function(enc) { } */ + + console.log('receiving '+JSON.stringify(payload)); + var self = this; switch (payload.type) { case 'disconnect': @@ -352,8 +352,7 @@ Network.prototype.send = function(copayerIds, payload, cb) { }; var copayerIdBuf = new Buffer(copayerId, 'hex'); var message = AuthMessage.encode(copayerIdBuf, self.getKey(), payload, opts); - console.log(JSON.stringify(payload)); - console.log(JSON.stringify(message)); + console.log('sending '+JSON.stringify(payload)); self.socket.emit('message', message); }); if (typeof cb === 'function') cb();