[Bug]: Prevent user from buying channel when node capacity is reached
Describe the bug
If the node has reached it's (legal) upper limit for capacity the LSP will throw an error like:
Channel open failed. {"message": "Node capacity is above our capacity limit. Contact us for more information.", "type": "CHANNEL_REJECTED_BY_LSP", "detail": {}, "name": "ChannelOpenError", "grenacheCall": {"workerName": "blocktank-lsp-ln2", "method": "orderChannel", "args":["<nodeId>", true, 1141097, {"pushBalanceSat": 1234567, "lspNodeId": "0296b2db342fcf87ea94d981757fdf4d3e545bd5cef4919f58b5d38dfdd73bf5c9", "zeroConf": false, "zeroReserve": true}], "options": {"timeoutMs":60000}}}
Bitkit should do some checks and prevent the user from buying addtional (large) channels.
Reproduce
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Screenshots / Recording
No response
Operating system
Android, iOS
Bitkit version
master
Log output
No response
We need a UI for that in order to explain to the user that he has hit his limits. @aldertnl
@pwltr and I have discussed some edge cases in this area that need revising.
Checked Transfer Funds Quick Setup slider view but still todo: Quick Setup manual input and Advanced flows.
Tested on 2c5b07726fd35cb796a9566c47d0f6c36fda4ef4 Looks good for the two Quick Setup flows (slider and manual entry) but the Advnaced flow show invalid options and proceeding results in one of two errors being displayed:
Tested on v128 e8f5056 I currently have one LN connection with Blocktank with 656_069 and one with LNBig for 192_020 receiving capacity (853_089 total = €491.99). When I go to transfer funds I am limisted to 40_196 sats receiving capacity (€515). This doesn't seem like enough, shouldn't I be allowed a lot more, up to near €999?
https://github.com/synonymdev/bitkit/assets/74595920/9bbaf094-e5cf-43fd-9ca9-03ba1cb53f94
The limit is about total channel size not receiving capacity only. That said it should only apply to Blocktank channels so there is a todo here.
This needs to be worked on together with https://github.com/synonymdev/bitkit/issues/1972
This area has been reworked and I cannot reproduce this issue in v1.0.8. It is possible to get close to 950 euro total capacity.