Permalink
Browse files

Merge pull request bitpay#9175 from Gamboster/fix/inputSendPageBCHLegacy

fix: Send Page input to accept Copay BCH legacy address format
  • Loading branch information...
cmgustavo committed Sep 28, 2018
2 parents 17ed8e8 + a982381 commit 97786b52747e4453ebb9362dd309d4eb4f0f281b
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/providers/address/address.ts
@@ -94,7 +94,6 @@ export class AddressProvider {
address: string
): boolean {
let addressData;
address = coin === 'bch' ? address.toLowerCase() : address;
if (this.isValid(address)) {
let extractedAddress = this.extractAddress(address);
addressData = this.validateAddress(extractedAddress);
@@ -110,7 +109,7 @@ export class AddressProvider {
public extractAddress(address: string): string {
let extractedAddress = address
.replace(/^(bitcoincash:|bchtest:|bitcoin:)/, '')
.replace(/^(bitcoincash:|bchtest:|bitcoin:)/i, '')
.replace(/\?.*/, '');
return extractedAddress || address;
}
@@ -139,7 +138,7 @@ export class AddressProvider {
if (isUriValid && (isAddressValidLivenet || isAddressValidTestnet)) {
return true;
}
} else if (/^bitcoincash:/.test(address) || /^bchtest:/.test(address)) {
} else if (/^bitcoincash:/i.test(address) || /^bchtest:/i.test(address)) {
let isUriValid = URICash.isValid(address);
if (isUriValid) {
uri = new URICash(address);

0 comments on commit 97786b5

Please sign in to comment.