apotdevin / thunderhub

ThunderHub LND Lightning Node Manager in your Browser
https://www.thunderhub.io/
MIT License
412 stars 84 forks source link

[BUG] "FETCH_FEES = false" flag setting ignored/not working fine #589

Open twofaktor opened 9 months ago

twofaktor commented 9 months ago

Describe the problem/bug When I set the .env.local file setting FETCH_FEES = false and I customize theMEMPOOL_URL= to use another URL, I can see the next on logs when I logged in:

Jul 18 12:33:30 minibolt2fa npm[144520]:   error: TypeError: fetch failed
Jul 18 12:33:30 minibolt2fa npm[144520]:       at Object.fetch (node:internal/deps/undici/undici:11457:11)
Jul 18 12:33:30 minibolt2fa npm[144520]:       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Jul 18 12:33:30 minibolt2fa npm[144520]:       at async BitcoinResolver.getBitcoinFees (/home/thunderhub/thunderhub/dist/modules/api/bitcoin/bitcoin.resolver.js:42:30)
Jul 18 12:33:30 minibolt2fa npm[144520]:       at async target (/home/thunderhub/thunderhub/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)
Jul 18 12:33:30 minibolt2fa npm[144520]:       at async Object.getBitcoinFees (/home/thunderhub/thunderhub/node_modules/@nestjs/core/helpers/external-proxy.js:9:24) {
Jul 18 12:33:30 minibolt2fa npm[144520]:     cause: Error: getaddrinfo ENOTFOUND mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion
Jul 18 12:33:30 minibolt2fa npm[144520]:         at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
Jul 18 12:33:30 minibolt2fa npm[144520]:       errno: -3008,
Jul 18 12:33:30 minibolt2fa npm[144520]:       code: 'ENOTFOUND',
Jul 18 12:33:30 minibolt2fa npm[144520]:       syscall: 'getaddrinfo',
Jul 18 12:33:30 minibolt2fa npm[144520]:       hostname: 'mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion'
Jul 18 12:33:30 minibolt2fa npm[144520]:     }
Jul 18 12:33:30 minibolt2fa npm[144520]:   },
Jul 18 12:33:30 minibolt2fa npm[144520]:   level: 'error',
Jul 18 12:33:30 minibolt2fa npm[144520]:   message: 'Error getting bitcoin fees',
Jul 18 12:33:30 minibolt2fa npm[144520]:   timestamp: '2023-07-18T12:33:30.668Z'
Jul 18 12:33:30 minibolt2fa npm[144520]: }
Jul 18 12:33:30 minibolt2fa npm[144520]: {
Jul 18 12:33:30 minibolt2fa npm[144520]:   context: 'ExceptionsHandler',
Jul 18 12:33:30 minibolt2fa npm[144520]:   stack: [
Jul 18 12:33:30 minibolt2fa npm[144520]:     'Error: Problem getting Bitcoin fees.\n' +
Jul 18 12:33:30 minibolt2fa npm[144520]:       '    at BitcoinResolver.getBitcoinFees (/home/thunderhub/thunderhub/dist/modules/api/bitcoin/bitcoin.resolver.js:57:19)\n' +
Jul 18 12:33:30 minibolt2fa npm[144520]:       '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
Jul 18 12:33:30 minibolt2fa npm[144520]:       '    at async target (/home/thunderhub/thunderhub/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)\n' +
Jul 18 12:33:30 minibolt2fa npm[144520]:       '    at async Object.getBitcoinFees (/home/thunderhub/thunderhub/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)'
Jul 18 12:33:30 minibolt2fa npm[144520]:   ],
Jul 18 12:33:30 minibolt2fa npm[144520]:   level: 'error',
Jul 18 12:33:30 minibolt2fa npm[144520]:   message: 'Problem getting Bitcoin fees.',
Jul 18 12:33:30 minibolt2fa npm[144520]:   timestamp: '2023-07-18T12:33:30.673Z'
Jul 18 12:33:30 minibolt2fa npm[144520]: }
Jul 18 12:34:03 minibolt2fa npm[144520]: {

thunderhub_mempoolfees_tor

Also, on ThunderHub, you can see the fees section when it shouldn't appear

thunderhub_mempoolfees_tor_3

Your environment

To Reproduce Steps to reproduce the behavior:

  1. Set FETCH_FEES = false and I customize the MEMPOOL_URL= to use another URL on .env.local
  2. Start ThunderHub
  3. Go to the default URL:PORT
  4. Login with your account
  5. You can see the fees section has been loaded and on ThunderHub logs a message Problem getting Bitcoin fees

Expected behavior FETCH_FEES = false should act and not show the fees section and nothing related to fees on ThunderHub outputs

Actual behavior Fees section + error Problem getting Bitcoin fees