bitkit icon indicating copy to clipboard operation
bitkit copied to clipboard

[Bug]: Prevent user from buying channel when node capacity is reached

Open pwltr opened this issue 1 year ago • 7 comments

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

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots / Recording

No response

Operating system

Android, iOS

Bitkit version

master

Log output

No response

pwltr avatar Feb 13 '24 12:02 pwltr

We need a UI for that in order to explain to the user that he has hit his limits. @aldertnl

JeanlChristophe avatar Feb 23 '24 12:02 JeanlChristophe

@pwltr and I have discussed some edge cases in this area that need revising.

catch-21 avatar Apr 19 '24 15:04 catch-21

Checked Transfer Funds Quick Setup slider view but still todo: Quick Setup manual input and Advanced flows.

catch-21 avatar May 08 '24 10:05 catch-21

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:

catch-21 avatar May 08 '24 11:05 catch-21

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

catch-21 avatar Jul 02 '24 16:07 catch-21

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.

pwltr avatar Jul 09 '24 08:07 pwltr

This needs to be worked on together with https://github.com/synonymdev/bitkit/issues/1972

pwltr avatar Sep 10 '24 10:09 pwltr

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.

catch-21 avatar Dec 24 '24 11:12 catch-21