lnworker: stop setting static jit alias for jit channel
...so we can have multiple just in time channels with the same lsp. We already save a remote scid alias in `on_channel_ready` which we already have received after the new zeroconf channel is in open state. So setting the alias to the static node id hash is counterproductive because it doesn't allow to differentiate between channels. Also extends the regtest (`just_in_time`) to do a second channel opening, to cover this scenario. This doesn't add much runtime to the test, so the cost seems reasonable.
This commit is contained in:
@@ -779,10 +779,24 @@ if [[ $1 == "just_in_time" ]]; then
|
||||
echo "carol pays alice"
|
||||
# note: set amount to 0.001 to test failure: 'payment too low'
|
||||
invoice=$($alice add_request 0.01 --lightning --memo "invoice" | jq -r ".lightning_invoice")
|
||||
success=$($carol lnpay $invoice| jq '.success')
|
||||
if [[ $success != "true" ]]; then
|
||||
echo "JIT payment failed"
|
||||
exit 1
|
||||
success=$($carol lnpay $invoice | jq -r ".success")
|
||||
if [[ "$success" != "true" ]]; then
|
||||
echo "jit payment failed"
|
||||
exit 1
|
||||
fi
|
||||
# try again, multiple jit openings should work without issues
|
||||
new_blocks 3
|
||||
echo "carol pays alice again"
|
||||
invoice=$($alice add_request 0.04 --lightning --memo "invoice2" | jq -r ".lightning_invoice")
|
||||
success=$($carol lnpay $invoice | jq -r ".success")
|
||||
if [[ "$success" != "true" ]]; then
|
||||
echo "jit payment failed"
|
||||
exit 1
|
||||
fi
|
||||
alice_chan_count=$($alice list_channels | jq '. | length')
|
||||
if [[ "$alice_chan_count" != "2" ]]; then
|
||||
echo "alice should have two jit channels"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user