diff --git a/js/controllers/transactions.js b/js/controllers/transactions.js index 37cc0dbd1..2d983d396 100644 --- a/js/controllers/transactions.js +++ b/js/controllers/transactions.js @@ -6,6 +6,9 @@ angular.module('copay.transactions').controller('TransactionsController', $scope.title = 'Transactions'; $scope.loading = false; + + + var _updateTxs = function() { var w =$rootScope.wallet; if (!w) return; @@ -99,4 +102,13 @@ angular.module('copay.transactions').controller('TransactionsController', }; _updateTxs(); + + var w = $rootScope.wallet; + if (w) { + w.on('txProposalsUpdated', function() { + console.log('[transactions.js.108: txProposalsUpdated:]'); //TODO + _updateTxs(); + $rootScope.$digest(); + }); + } }); diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index a5c7d07de..ba30c175f 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -60,6 +60,7 @@ Wallet.prototype._handlePublicKeyRing = function(senderId, data, isInbound) { this._lockIncomming(); } } + this.emit('publicKeyRingUpdated', this.publicKeyRing); this.store(); }; @@ -76,6 +77,7 @@ Wallet.prototype._handleTxProposals = function(senderId, data, isInbound) { recipients = null; this.sendTxProposals(recipients); } + this.emit('txProposalsUpdated', this.txProposals); this.store(); }; @@ -242,7 +244,6 @@ Wallet.prototype.sendTxProposals = function(recipients) { txProposals: this.txProposals.toObj(), walletId: this.id, }); - this.emit('txProposalsUpdated', this.txProposals); }; Wallet.prototype.sendWalletReady = function(recipients) { @@ -274,7 +275,6 @@ Wallet.prototype.sendPublicKeyRing = function(recipients) { publicKeyRing: this.publicKeyRing.toObj(), walletId: this.id, }); - this.emit('publicKeyRingUpdated', this.publicKeyRing); }; diff --git a/js/models/network/WebRTC.js b/js/models/network/WebRTC.js index 5c7eda48c..556763ed3 100644 --- a/js/models/network/WebRTC.js +++ b/js/models/network/WebRTC.js @@ -201,6 +201,8 @@ console.log('[WebRTC.js.161:payload:]',payload); //TODO } var copayerIdBuf = new Buffer(this.copayerForPeer[peerId],'hex'); + +console.log('[WebRTC.js.204] sig:', sig); //TODO if (!bitcore.Message.verifyWithPubKey( copayerIdBuf, JSON.stringify(payload), new Buffer(sig,'hex'))) { console.log('[WebRTC.js.152] SIGNATURE VERIFICATION FAILED!!'); //TODO