trying to get past intermediate screen

This commit is contained in:
Manuel Araoz 2014-08-13 17:27:33 -04:00
commit cae11776ac
3 changed files with 10 additions and 7 deletions

View file

@ -377,6 +377,7 @@ PublicKeyRing.prototype._checkInPKR = function(inPKR, ignoreId) {
PublicKeyRing.prototype._mergePubkeys = function(inPKR) { PublicKeyRing.prototype._mergePubkeys = function(inPKR) {
alert('merge pubkeys');
var self = this; var self = this;
var hasChanged = false; var hasChanged = false;

View file

@ -318,15 +318,19 @@ Wallet.prototype._handleAddressBook = function(senderId, data, isInbound) {
Wallet.prototype._handleData = function(senderId, data, isInbound) { Wallet.prototype._handleData = function(senderId, data, isInbound) {
alert(JSON.stringify(data));
if (data.type !== 'walletId' && this.id !== data.walletId) { if (data.type !== 'walletId' && this.id !== data.walletId) {
this.emit('badMessage', senderId); this.emit('badMessage', senderId);
this.log('badMessage FROM:', senderId); this.log('badMessage FROM:', senderId);
alert('fuck');
return; return;
} }
switch (data.type) { switch (data.type) {
// This handler is repeaded on WalletFactory (#join). TODO // This handler is repeaded on WalletFactory (#join). TODO
case 'walletId': case 'walletId':
alert('walletID received');
this.sendWalletReady(senderId); this.sendWalletReady(senderId);
break; break;
case 'walletReady': case 'walletReady':
@ -356,7 +360,6 @@ Wallet.prototype._handleData = function(senderId, data, isInbound) {
}; };
Wallet.prototype._handleConnect = function(newCopayerId) { Wallet.prototype._handleConnect = function(newCopayerId) {
alert(newCopayerId);
if (newCopayerId) { if (newCopayerId) {
this.log('#### Setting new COPAYER:', newCopayerId); this.log('#### Setting new COPAYER:', newCopayerId);
this.sendWalletId(newCopayerId); this.sendWalletId(newCopayerId);
@ -1727,7 +1730,7 @@ Wallet.prototype.indexDiscovery = function(start, change, copayerIndex, gap, cb)
function _while() { function _while() {
return hasActivity; return hasActivity;
}, },
function _finnaly(err) { function _finally(err) {
if (err) return cb(err); if (err) return cb(err);
cb(null, lastActive); cb(null, lastActive);
} }

View file

@ -199,14 +199,11 @@ Network.prototype._onMessage = function(enc) {
return; return;
} }
if (this.allowedCopayerIds && !this.allowedCopayerIds[payload.copayerId]) { if (this.allowedCopayerIds && !this.allowedCopayerIds[payload.copayerId]) {
this._deletePeer(sender); this._deletePeer(sender);
return; return;
} }
// TODO // TODO
/* /*
if (!this.copayerForPeer[sender] || (isInbound && !this.isInboundPeerAuth[sender])) { 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; var self = this;
switch (payload.type) { switch (payload.type) {
case 'disconnect': case 'disconnect':
@ -352,8 +352,7 @@ Network.prototype.send = function(copayerIds, payload, cb) {
}; };
var copayerIdBuf = new Buffer(copayerId, 'hex'); var copayerIdBuf = new Buffer(copayerId, 'hex');
var message = AuthMessage.encode(copayerIdBuf, self.getKey(), payload, opts); var message = AuthMessage.encode(copayerIdBuf, self.getKey(), payload, opts);
console.log(JSON.stringify(payload)); console.log('sending '+JSON.stringify(payload));
console.log(JSON.stringify(message));
self.socket.emit('message', message); self.socket.emit('message', message);
}); });
if (typeof cb === 'function') cb(); if (typeof cb === 'function') cb();