diff --git a/index.html b/index.html
index a584949a3..b26c1517c 100644
--- a/index.html
+++ b/index.html
@@ -215,7 +215,11 @@
diff --git a/js/controllers/addresses.js b/js/controllers/addresses.js
index 4f644208c..c92c7ea76 100644
--- a/js/controllers/addresses.js
+++ b/js/controllers/addresses.js
@@ -11,9 +11,10 @@ angular.module('copay.addresses').controller('AddressesController',
var _updateBalance = function () {
controllerUtils.setSocketHandlers();
- w.getBalance(function (balance, balanceByAddr) {
+ w.getBalance(function (balance, balanceByAddr, isMain) {
if (balanceByAddr && Object.keys(balanceByAddr).length) {
$rootScope.balanceByAddr = balanceByAddr;
+ $scope.isMain = isMain;
$scope.addrs = Object.keys(balanceByAddr);
$scope.selectedAddr = $scope.addrs[0];
$rootScope.$digest();
diff --git a/js/models/blockchain/Insight.js b/js/models/blockchain/Insight.js
index fb77b7d73..85c5e156b 100644
--- a/js/models/blockchain/Insight.js
+++ b/js/models/blockchain/Insight.js
@@ -100,15 +100,9 @@ Insight.prototype._request = function(options, callback) {
if (request.readyState === 4) {
console.log('[Insight.js.102]', request); //TODO
if (request.status === 200) {
- try {
- return callback(null, JSON.parse(request.responseText));
- } catch (e) {
-
-console.log('[Insight.js.106]'); //TODO
- return callback({message: 'Wrong response from insight'});
- }
- } else {
-
+ return callback(null, JSON.parse(request.responseText));
+ }
+ else {
console.log('[Insight.js.111]'); //TODO
return callback({message: 'Error ' + request.status});
}
diff --git a/js/models/core/PublicKeyRing.js b/js/models/core/PublicKeyRing.js
index 32cd4d5c9..a2a26ce58 100644
--- a/js/models/core/PublicKeyRing.js
+++ b/js/models/core/PublicKeyRing.js
@@ -212,6 +212,7 @@ PublicKeyRing.prototype.getAddresses = function(onlyMain) {
PublicKeyRing.prototype.getRedeemScriptMap = function () {
var ret = {};
+console.log('[PublicKeyRing.js.216]', this.changeAddressIndex, this.addressIndex); //TODO
for (var i=0; i