Closed vanditshah99 closed 1 week ago
Comment is edited
Adding some more context here:
This is a known existing gap due to this logic: https://github.com/lightninglabs/taproot-assets/blob/30e71665dddd23599eedb39e3caf3b057279ca03/rpcserver.go#L7291-L7297
Setting rfq_peer_pubkey
does help with the issue referenced above, but in this case it appears that there're two channels with the same asset ID to the same node, which causes the check above to fail.
I think one solution here would be to just select one of the channels, the one that has the highest local balance that can satisfy the payment. We only need to extract the peer pubkey, and an amt for the max asset unit: https://github.com/lightninglabs/taproot-assets/blob/30e71665dddd23599eedb39e3caf3b057279ca03/rpcserver.go#L6896-L6899
We should be able to reproduce this with an itest by creating the scenario of two channels w/ the same asset ID to a single node, with one node paying an invoice created by another.
I think this is actually a simpler issue in this case, where the CLI cmd is a bit off and not propagating the peer pubkey.
One place I see a gap is the handling of outgoing_chan_id
; AFAICT right now that gets passed through to LND without any special handling by tapd. I think this should be added as a filter to rfqChannel()
so that the user could select a specific channel with a peer.
Otherwise, a specific channel is selected by the output of rfqChannel()
before that argument is ever handled.
Notes:
Will the code pick from two different channels? Enumerate a testing scenario between two or three peers.
Background
Your environment
Steps to reproduce
Multi-Hop Payment, where there is a sender having multiple assets channel for the same asset with the peer. We tried the following command
Also, we tried passing the channel id as well
Expected behavior
This invoice should be paid through, auto selection of channel, and if outgoing chan id is passed, It shouldn't restrict and try using that channel
Actual behavior
It fails with the following error