Skip to content

Commit

Permalink
chore: update closest estimation code
Browse files Browse the repository at this point in the history
  • Loading branch information
slavastartsev committed Sep 25, 2024
1 parent 26dd205 commit d524302
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sdk/src/esplora.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,10 @@ export class EsploraClient {
async getFeeEstimate(confirmationTarget: number): Promise<number> {
const response = await this.getJson<Record<number, number>>(`${this.basePath}/fee-estimates`);
if (response[confirmationTarget]) return response[confirmationTarget];
const TARGET_MAX = 1008;
for (let target = confirmationTarget + 1; target <= TARGET_MAX; target++) {
if (response[target]) return response[target];
}
const [_, result] = Object.entries(response)

Check warning on line 337 in sdk/src/esplora.ts

View workflow job for this annotation

GitHub Actions / SDK

'_' is assigned a value but never used
.sort(([a], [b]) => Number(b) - Number(a))
.pop();
return result;
}

/**
Expand Down

0 comments on commit d524302

Please sign in to comment.