2

Description

I have two peers: p1 and p2 running lightning-core

p1 opened a channel to p2 and p2 opened another channel to p1.

Now p2 has two channels. One with outbound funding and one with 0. Output of listfunds:

"channels": [      
      {
         "peer_id": "02e7b2196a87513ef322fc2c23d5739ed4ac696a9010a855dbfe7185fe8e133c93",
         "connected": true,
         "state": "CHANNELD_NORMAL",
         "short_channel_id": "2410508x70x0",
         "channel_sat": 0,
         "our_amount_msat": "0msat",
         "channel_total_sat": 113495,
         "amount_msat": "113495000msat",
         "funding_txid": "1f5284dbfcaf76e8a333c1c607465a9474294f43cfbcbbb34504d97aac2189a4",
         "funding_output": 0
      },
      {
         "peer_id": "02e7b2196a87513ef322fc2c23d5739ed4ac696a9010a855dbfe7185fe8e133c93",
         "connected": true,
         "state": "CHANNELD_NORMAL",
         "short_channel_id": "2410509x222x0",
         "channel_sat": 90433,
         "our_amount_msat": "90433000msat",
         "channel_total_sat": 90433,
         "amount_msat": "90433000msat",
         "funding_txid": "befde7cbd4965f21fe9df3a1f06eb1968109a7246457aabed58bfe39f6694b08",
         "funding_output": 0
      }
   ]

Problem

Now I tried to pay a 1000msat p1 invoice from p2 and get the error:

failed: WIRE_TEMPORARY_CHANNEL_FAILURE (WIRE_TEMPORARY_CHANNEL_FAILURE: Capacity exceeded - HTLC fee: 183sat)

I think this is because p2 tries to send using the not funded channel 2410508x70x0. Because if I delete this channel, all works as expected.

Additional information:

Also getroute shows that channel 2410508x70x0 is used:

$ lightning-cli --testnet getroute 02e7b2196a87513ef322fc2c23d5739ed4ac696a9010a855dbfe7185fe8e133c93 1000 0
{
   "route": [
      {
         "id": "02e7b2196a87513ef322fc2c23d5739ed4ac696a9010a855dbfe7185fe8e133c93",
         "channel": "2410508x70x0",
         "direction": 1,
         "msatoshi": 1000,
         "amount_msat": "1000msat",
         "delay": 9,
         "style": "tlv"
      }
   ]
}

Questions

  • Why does p2 does not auto select the funded channel?
  • Is there a way to select the channel? I did not find an option for pay.
3
  • 1
    Is it possible that blockstream.info/testnet/tx/… didn't have three confirmations yet, when you tried to make that payment?—Does it work meanwhile?
    – Murch
    Dec 9, 2022 at 16:29
  • Tried once again with the same channel, still the same error. (the one I deleted was from a previous test).
    – timmornYE
    Dec 9, 2022 at 17:05
  • Please look at additional information. Also, getroute shows that the wrong channel is used.
    – timmornYE
    Dec 9, 2022 at 17:46

1 Answer 1

1
  • Why does p2 not auto-select the funded channel?

In this case, I guess that the pay plugin is smart enough to select the peer with the correct channel, or better is not able to choose the right channel of the peer. I guess this is a limitation of the pay plugin, also if I do not remember the code, maybe if you open an issue we can take a look at what is going on in your case!

  • Is there a way to select the channel? I did not find an option for payment.

Yes you can use the sendpay command that allows you to specify the route, this is a low-level command but it is a good way to have the power to choose the route

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.