get10101 / 10101-PoC

The world needs more Lightning!
MIT License
17 stars 3 forks source link

Pending after receiving over lightning does not go away #313

Closed da-kami closed 1 year ago

bonomat commented 1 year ago

Taking over @klochowicz

bonomat commented 1 year ago

The problem is that we do not get the right events but receivePendingHtlcsForwradable. We should though get: PaymentReceived and then PaymentClaimed

It looks like the problem is on the taker side: I was able to open a channel from ldk-sample with our maker, create an invoice on ldk-sample and pay it from the maker.

The code for creating the invoice looks the same to me but maybe we call something on a channel_manager in a different context. That's probably the same reason why we sometimes get random errors ala: can't find route.

bonomat commented 1 year ago

Unasigning myself if someone else wants to have a look.

bonomat commented 1 year ago

Additional info:

This makes me think that our code is correct but it has something todo with how we store state. It could be that the channel_manager or key_store does not know about the hash/secret when receiving the payment and hence does not accept the payment.

klochowicz commented 1 year ago

@bonomat did you try ldk-sample or ldk-bdk-sample? was this an outgoing channel from the sample to the maker?

bonomat commented 1 year ago

@bonomat did you try ldk-sample or ldk-bdk-sample? was this an outgoing channel from the sample to the maker?

I used our ldk-sample fork: https://github.com/itchysats/ldk-sample/

I've always opened a channel to the maker from either taker or ldk-sample

klochowicz commented 1 year ago

can you check whether it works for you with ldk-bdk-sample? https://github.com/klochowicz/ldk-bdk-sample

I can't get the payment to work this way now: {"status":500,"title":"Failed to pay lightning invoice","detail":"LightningError { err: \"Failed to find a path to the given destination\", action: IgnoreError }"}%

which is weird, I have an open and usable channel direct channel with the other party, and the destination is correct.

klochowicz commented 1 year ago

I think I found something, I managed to successfully pay the taker.

bonomat commented 1 year ago

I think I found something, I managed to successfully pay the taker.

woop woop... i'm curious :)

klochowicz commented 1 year ago

I think I found something, I managed to successfully pay the taker.

woop woop... i'm curious :)

was too excited I think 😢 I got around some of the errors, but I still get the one you mentioned. Added some in-between PR, and continuing the work: https://github.com/itchysats/10101/pull/349