Skip to content

Commit

Permalink
Fallback to single entry with minfee if no estimates
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Feb 13, 2024
1 parent 79ba2b2 commit 6fd3c45
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ function calculateFees(mempoolFeeEstimates: MempoolFeeEstimates, esploraFeeEstim
const minFee = (mempoolFeeEstimates?.minimumFee ?? FEE_MINIMUM) * 1000;
logger.debug({ message: 'Using minimum fee: {minFee}', minFee });

// If we didn't manage to get any fee estimates, return a single estimate with the minimum fee.
if (Object.keys(feeByBlockTarget).length === 0) {
return { 1: minFee }
}

// Return fees filterd to remove any that are lower than the determined minimum fee.
if (minFee) {
return filterEstimates(feeByBlockTarget, minFee);
Expand Down

0 comments on commit 6fd3c45

Please sign in to comment.