LndHub icon indicating copy to clipboard operation
LndHub copied to clipboard

remove %1 fee by internal invoice

Open TheCherry opened this issue 4 years ago • 9 comments

What will happen if we move the if statement:

https://github.com/BlueWallet/LndHub/blob/master/controllers/api.js#L238

to the regular lightning network logic:

https://github.com/BlueWallet/LndHub/blob/master/controllers/api.js#L290

In the end we don't need to check internal for the fee, am I right?

TheCherry avatar Sep 20 '21 14:09 TheCherry

You can now set fees in the config.js file on version 1.4.0

forwardReserveFee: 0.01, // default 0.01 intraHubFee: 0.003, // default 0.003

xraid avatar Sep 23 '21 15:09 xraid

where can I find config.js on umbrel directory?

Blazerinho avatar Dec 10 '21 11:12 Blazerinho

and can I see who gets intrahubfee?

Blazerinho avatar Dec 10 '21 12:12 Blazerinho

in folder lndhub/config.js You can adjust fees

intrahubfee is for all accounts connected to the LndHub instance

xraid avatar Dec 10 '21 12:12 xraid

docker exec -it "mycontainer" bash

and nano config.js

xraid avatar Dec 10 '21 12:12 xraid

You can now set fees in the config.js file on version 1.4.0

forwardReserveFee: 0.01, // default 0.01 intraHubFee: 0.003, // default 0.003

As the code stands right now, we cannot set the internal hub fee to zero. Setting intraHubFee: 0.000 in config.js does not change the fee to zero because the code does not catch it due to simple using the OR operator in order to set default values.

https://github.com/BlueWallet/LndHub/blob/05eace759fdb7b2b3e84b2b8b1e92161b68e0d2b/controllers/api.js#L19-L25

Perhaps a more robust check on whether the variable is defined is needed.

hazrulnizam avatar Dec 30 '21 06:12 hazrulnizam

yeah a change was made in good faith here : https://github.com/BlueWallet/LndHub/commit/e42ef3a85e3792d61a5c0e4ae124ec4c48797e64

xraid avatar Dec 30 '21 12:12 xraid

Finally I found a workaround to set fees to zero. dirty but it works as long you don't restart umbrel. 'login to umbrel using cmd 'Enter following command to get into umbrel SSH -t [email protected] 'Enter "your umbrel password" 'find out and note container ID of bluewalletorganization/lndhub:v1.4.1 with Docker ps 'get into Container docker exec -u 0 -it "Bluewallet Container ID" /bin/sh 'update library apt-get update 'install nano apt-get install nano 'edit file api.js nano /lndhub/controllers/api.js 'modify line of fees global.forwardFee = 0.00; global.internalFee = 0.000; 'CTRL + X to save 'restart docker docker restart "Bluewallet Container ID" exit

Blazerinho avatar Feb 04 '22 15:02 Blazerinho

@hazrulnizam you are right. Due to || being a boolean logical operator, the left hand-side operand was coerced to a boolean for the evaluation and any falsy value (0, '', NaN, null, undefined) was not returned. This behavior may cause unexpected consequences if you consider 0, '', or NaN as valid values. I guess that 0.00 is also a falsy value. Can anybody debug that behavior? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator

Blazerinho avatar Feb 11 '22 13:02 Blazerinho