Review Transaction screen now displaying BCH addresses in cashaddr format.

This commit is contained in:
Brendon Duncan 2018-08-09 12:12:29 +12:00
commit be0c18244e

View file

@ -403,16 +403,20 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
// Check if the recipient is a contact // Check if the recipient is a contact
addressbookService.get(originCoin + address, function(err, contact) { addressbookService.get(originCoin + address, function(err, contact) {
if (!err && contact) { if (!err && contact) {
handleDestinationAsContact(contact); handleDestinationAsAddressOfContact(contact);
} else { } else {
vm.destination.address = address; if (originCoin === 'bch') {
vm.destination.address = bitcoinCashJsService.readAddress(address).cashaddr;
} else {
vm.destination.address = address;
}
vm.destination.kind = 'address'; vm.destination.kind = 'address';
} }
}); });
} }
function handleDestinationAsContact(contact) { function handleDestinationAsAddressOfContact(contact) {
vm.destination.kind = 'contact'; vm.destination.kind = 'contact';
vm.destination.name = contact.name; vm.destination.name = contact.name;
vm.destination.email = contact.email; vm.destination.email = contact.email;