Merge pull request #120 from Bitcoin-com/wallet/task/321
Improvement - 321 - "Search transactions" doesn't work with BCH prefix
This commit is contained in:
commit
323c3c2219
1 changed files with 14 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('searchController', function($scope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, $ionicScrollDelegate, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService) {
|
||||
angular.module('copayApp.controllers').controller('searchController', function($scope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, $ionicScrollDelegate, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService, bitcoinCashJsService) {
|
||||
|
||||
var HISTORY_SHOW_LIMIT = 10;
|
||||
var currentTxHistoryPage = 0;
|
||||
|
|
@ -29,6 +29,19 @@ angular.module('copayApp.controllers').controller('searchController', function($
|
|||
var message = tx.message ? tx.message : '';
|
||||
var comment = tx.note ? tx.note.body : '';
|
||||
var addressTo = tx.addressTo ? tx.addressTo : '';
|
||||
|
||||
if ($scope.wallet.coin === 'bch') {
|
||||
|
||||
/**
|
||||
* For each address
|
||||
* I translate the legacy address and add in the searchable string the 3 kind of addresses
|
||||
*/
|
||||
lodash.each(tx.outputs, function(output) {
|
||||
var addr = bitcoinCashJsService.translateAddresses(output.address);
|
||||
addressTo += addr.legacy + addr.bitpay + 'bitcoincash:' + addr.cashaddr
|
||||
});
|
||||
}
|
||||
|
||||
var txid = tx.txid ? tx.txid : '';
|
||||
return ((tx.amountStr + message + addressTo + addrbook + searchableDate + comment + txid).toString()).toLowerCase();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue