lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.55k stars 2.06k forks source link

pathfinding/routing #8368

Open amicwall opened 5 months ago

amicwall commented 5 months ago

Background

LND tries routes which are guaranteed to fail:

invoice amount: 850000 sats my Bitrefill channel size: 500000 sats TEMPORARY_CHANNEL_FAILURE @ 1st hop | 19.935 | 20.517 | 67581.007 | 77.523 | 825448 | 821493515745165313 | Bitrefill Routing->03ea344e1e2551f12f39->Breez->0216aa

At other times, LND also tries channels where my local channel balance is below the invoice amount

Your environment

lnd: v0.17.2-beta linux: 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 Bitcoin Core version v22.0.0

Expected behavior

check that local channel balance is greater than invoice amount before trying to use channel

ziggie1984 commented 5 months ago

Are you using SendPaymentV2 rpc call ? Lnd will use MPP with a max-shard size of 16 (default). So basically LND is splitting the amount to deliver it to the destination, so it will consider more than 1 channel.

amicwall commented 5 months ago

yes I am using the python lib call SendPaymentV2. Python lib router_pb2.py says SendPayment is deprecated, use SendPaymentV2. Ok so LND is splitting the amount. Shouldn't it try to use channels first, that have a big local balance so that MPP is not necessary ?

ziggie1984 commented 5 months ago

Normally it does, the logs will tell you which edges where considered when you increase the log level of the CRTR subsystem. Before splitting the amount you would have a log line which says pathfinding failed for that particular amount can you see that in your logs ?

amicwall commented 5 months ago

I have lnd.conf log level = info, don't see anything about "pathfinding failed"