Only lowercase bech32 addresses in address prefix search.

fixes #327
This commit is contained in:
softsimon 2021-02-03 17:13:29 +07:00
parent de035dc1b5
commit 0c979e9440
No known key found for this signature in database
GPG key ID: 488D7DCFB5A430D7

View file

@ -85,6 +85,9 @@ export class ElectrsApiService {
} }
getAddressesByPrefix$(prefix: string): Observable<string[]> { getAddressesByPrefix$(prefix: string): Observable<string[]> {
return this.httpClient.get<string[]>(this.apiBaseUrl + this.apiBasePath + '/api/address-prefix/' + prefix.toLowerCase()); if (prefix.toLowerCase().indexOf('bc1') === 0) {
prefix = prefix.toLowerCase();
}
return this.httpClient.get<string[]>(this.apiBaseUrl + this.apiBasePath + '/api/address-prefix/' + prefix);
} }
} }