add in error message how high are estimated fees when too high (#1634)

This commit is contained in:
Riccardo Balbo 2024-11-22 15:26:18 +01:00 committed by GitHub
parent 923ddb74ca
commit 83341d5b7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -181,7 +181,7 @@ export default async function wrapInvoice ({ bolt11, feePercent }, { msats, desc
const minEstFees = toPositiveNumber(routingFeeMsat) const minEstFees = toPositiveNumber(routingFeeMsat)
const outgoingMaxFeeMsat = Math.ceil(toPositiveNumber(msats * MAX_FEE_ESTIMATE_PERCENT) / 100) const outgoingMaxFeeMsat = Math.ceil(toPositiveNumber(msats * MAX_FEE_ESTIMATE_PERCENT) / 100)
if (minEstFees > outgoingMaxFeeMsat) { if (minEstFees > outgoingMaxFeeMsat) {
throw new Error('Estimated fees are too high') throw new Error('Estimated fees are too high (' + minEstFees + ' > ' + outgoingMaxFeeMsat + ')')
} }
// calculate the incoming invoice amount, without fees // calculate the incoming invoice amount, without fees