Skip to content

Commit 7e9c4b4

Browse files
author
Jean-Baptiste Dominguez
authored
Merge pull request #433 from Bitcoin-com/wallet/hotfix/675
Wallet/hotfix/675
2 parents ee65e6a + 35e5c36 commit 7e9c4b4

4 files changed

Lines changed: 16 additions & 55 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,6 @@ www/img/app
108108
/GoogleService-Info.plist
109109
/google-services.json
110110
src/js/generated
111+
112+
##Intellij
113+
.idea

app-template/bitcoincom/appConfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c",
2525
"pushSenderId": "1036948132229",
2626
"description": "A Secure Bitcoin Wallet",
27-
"version": "5.2.0",
28-
"fullVersion": "5.2-rc1",
29-
"androidVersion": "502000",
27+
"version": "5.2.1",
28+
"fullVersion": "5.2-hotfix1",
29+
"androidVersion": "502100",
3030
"_extraCSS": "",
3131
"_enabledExtensions": {
3232
"coinbase": false,

src/js/controllers/customAmount.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ angular.module('copayApp.controllers').controller('customAmountController', func
119119
}
120120

121121
if ($scope.wallet.coin == 'bch') {
122-
currentAddressSocket = new WebSocket('wss://ws.blockchain.info/bch/inv');
122+
currentAddressSocket = new WebSocket('ws://47.254.143.172:80/v1/address');
123123
} else {
124-
currentAddressSocket = new WebSocket('wss://ws.blockchain.info/inv/');
124+
currentAddressSocket = new WebSocket('ws://47.254.143.172:81/v1/address');
125125
}
126126

127127
paymentSubscriptionObj.addr = address;
@@ -142,7 +142,7 @@ angular.module('copayApp.controllers').controller('customAmountController', func
142142
var receivedPayment = function(data) {
143143
data = JSON.parse(data);
144144

145-
if (data.op == 'utx') {
145+
if (data) {
146146
$scope.showingPaymentReceived = true;
147147
$scope.$apply();
148148
}

src/js/controllers/tab-receive.js

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
3535

3636
if ($scope.wallet.coin === 'bch') {
3737
// listen to bch address
38-
currentAddressSocket = new WebSocket('wss://ws.blockchain.info/bch/inv');
38+
currentAddressSocket = new WebSocket('ws://47.254.143.172:80/v1/address');
3939
paymentSubscriptionObj.addr = $scope.addrBchLegacy;
4040
} else {
4141
// listen to btc address
42-
currentAddressSocket = new WebSocket('wss://ws.blockchain.info/inv');
42+
currentAddressSocket = new WebSocket('ws://47.254.143.172:81/v1/address');
4343
paymentSubscriptionObj.addr = $scope.addr;
4444
}
4545

@@ -109,55 +109,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
109109

110110
var receivedPayment = function(data) {
111111
data = JSON.parse(data);
112-
//example payment data
113-
/*{
114-
"op": "utx",
115-
"x": {
116-
"lock_time": 0,
117-
"ver": 1,
118-
"size": 192,
119-
"inputs": [
120-
{
121-
"sequence": 4294967295,
122-
"prev_out": {
123-
"spent": true,
124-
"tx_index": 99005468,
125-
"type": 0,
126-
"addr": "1BwGf3z7n2fHk6NoVJNkV32qwyAYsMhkWf",
127-
"value": 65574000,
128-
"n": 0,
129-
"script": "76a91477f4c9ee75e449a74c21a4decfb50519cbc245b388ac"
130-
},
131-
"script": "483045022100e4ff962c292705f051c2c2fc519fa775a4d8955bce1a3e29884b2785277999ed02200b537ebd22a9f25fbbbcc9113c69c1389400703ef2017d80959ef0f1d685756c012102618e08e0c8fd4c5fe539184a30fe35a2f5fccf7ad62054cad29360d871f8187d"
132-
}
133-
],
134-
"time": 1440086763,
135-
"tx_index": 99006637,
136-
"vin_sz": 1,
137-
"hash": "0857b9de1884eec314ecf67c040a2657b8e083e1f95e31d0b5ba3d328841fc7f",
138-
"vout_sz": 1,
139-
"relayed_by": "127.0.0.1",
140-
"out": [
141-
{
142-
"spent": false,
143-
"tx_index": 99006637,
144-
"type": 0,
145-
"addr": "1A828tTnkVFJfSvLCqF42ohZ51ksS3jJgX",
146-
"value": 65564000,
147-
"n": 0,
148-
"script": "76a914640cfdf7b79d94d1c980133e3587bd6053f091f388ac"
149-
}
150-
]
151-
}
152-
}*/
153-
154-
if (data.op == "utx") {
112+
if (data) {
155113
var watchAddress = $scope.wallet.coin == 'bch' ? $scope.addrBchLegacy : $scope.addr;
156-
for (var i = 0; i < data.x.out.length; i++) {
157-
if (data.x.out[i].addr == watchAddress) {
158-
$scope.paymentReceivedAmount = txFormatService.formatAmount(data.x.out[i].value, 'full');
114+
for (var i = 0; i < data.outputs.length; i++) {
115+
if (data.outputs[i].address == watchAddress) {
116+
$scope.paymentReceivedAmount = txFormatService.formatAmount(data.outputs[i].value, 'full');
159117
$scope.paymentReceivedAlternativeAmount = ''; // For when a subsequent payment is received.
160-
txFormatService.formatAlternativeStr($scope.wallet.coin, data.x.out[i].value, function(alternativeStr){
118+
txFormatService.formatAlternativeStr($scope.wallet.coin, data.outputs[i].value, function(alternativeStr){
161119
if (alternativeStr) {
162120
$scope.$apply(function () {
163121
$scope.paymentReceivedAlternativeAmount = alternativeStr;

0 commit comments

Comments
 (0)