mirror of https://github.com/BTCPrivate/copay.git
fix "hello" for authenticated peers
This commit is contained in:
parent
8c72476857
commit
6cf8988eae
|
@ -174,7 +174,8 @@ Network.prototype._onData = function(encStr, isInbound, peerId) {
|
|||
console.log('### RECEIVED INBOUND?:%s TYPE: %s FROM %s',
|
||||
isInbound, payload.type, peerId, payload);
|
||||
|
||||
if(payload.type === 'hello' && !this.authenticatedPeers[peerId]) {
|
||||
if(payload.type === 'hello' ) {
|
||||
if (!this.authenticatedPeers[peerId]) {
|
||||
var payloadStr = JSON.stringify(payload);
|
||||
if (this.allowedCopayerIds && !this.allowedCopayerIds[payload.copayerId]) {
|
||||
console.log('#### Peer is not on the allowedCopayerIds. Closing connection',
|
||||
|
@ -182,6 +183,7 @@ Network.prototype._onData = function(encStr, isInbound, peerId) {
|
|||
this._deletePeer(peerId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
console.log('#### Peer sent hello. Setting it up.'); //TODO
|
||||
this._setPeerAuthenticated(peerId);
|
||||
this._addCopayer(payload.copayerId, isInbound);
|
||||
|
|
|
@ -88,6 +88,7 @@ angular.module('copay.controllerUtils')
|
|||
|
||||
root.setSocketHandlers = function() {
|
||||
Socket.removeAllListeners();
|
||||
if (!$rootScope.wallet) return;
|
||||
|
||||
var addrs = $rootScope.wallet.getAddressesStr();
|
||||
for (var i = 0; i < addrs.length; i++) {
|
||||
|
|
Loading…
Reference in New Issue