From cccf3b16f15d0fc7dd2948fcdc01775abc3e7de5 Mon Sep 17 00:00:00 2001 From: Kenny Joseph Date: Mon, 31 Jul 2023 13:29:51 -0400 Subject: [PATCH] LTC fee bug compensation --- packages/bitcore-node/src/routes/api/fee.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/bitcore-node/src/routes/api/fee.ts b/packages/bitcore-node/src/routes/api/fee.ts index 3659f5e2e1b..0124bef90d9 100644 --- a/packages/bitcore-node/src/routes/api/fee.ts +++ b/packages/bitcore-node/src/routes/api/fee.ts @@ -20,6 +20,11 @@ router.get('/:target', CacheMiddleware(CacheTimes.Second), async (req: Request, if (!fee) { return res.status(404).send('not available right now'); } + // As of v0.21.2.2, Litecoin Core has a bug where it returns a fee rate of 0.00000999 which is below the min relay fee (0.00001). + // TODO: remove this if statement once https://github.com/litecoin-project/litecoin/issues/908 is fixed. + if (chain === 'LTC' && fee.feerate && fee.feerate < 0.00001) { + fee.feerate = 0.00001; + } feeCache[`${chain}:${network}:${target}`] = { fee, date: Date.now() }; return res.json(fee); } catch (err) {