Skip to content

Commit

Permalink
Reduced number of requests to Electrum server
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszslabon committed Nov 6, 2023
1 parent e602184 commit cbba148
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typescript/src/lib/electrum/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,14 +507,14 @@ export class ElectrumClient implements BitcoinClient {
*/
getTxHashesForPublicKeyHash(publicKeyHash: Hex): Promise<BitcoinTxHash[]> {
return this.withElectrum<BitcoinTxHash[]>(async (electrum: Electrum) => {
const bitcoinNetwork = await this.getNetwork()

// eslint-disable-next-line camelcase
type HistoryItem = { height: number; tx_hash: string }

const getConfirmedHistory = async (
witnessAddress: boolean
): Promise<HistoryItem[]> => {
const bitcoinNetwork = await this.getNetwork()

const address = BitcoinAddressConverter.publicKeyHashToAddress(
publicKeyHash,
witnessAddress,
Expand Down

0 comments on commit cbba148

Please sign in to comment.