Closed NicolasDorier closed 1 week ago
I tried on 24.08.2 as well, same result... May not be a problem from CLN, as I switched the merchant side from CLN to LND and got same behavior... (keeping the customer as CLN)
Something I don't understand about lightning I guess...
This works as expected. The cause for your inability to send from the fundee is rather simple: you are not meeting the reserve yet.
The reserve is a minimum amount of satoshis that (once you exceed it) you can no longer dip below it. It is usually set to 1% of the funding amount, and is there so that both parties have a stake in the future of the channel, and is enforced by the peer. If we were to let a peer drain its channels completely, then they could cheat without risking any funds, since they don't have any more in the channel. By forcing the peer to keep 1% in their channel this cannot happen. As fundee you start out with no funds on your side, so any amount received goes to fill the reserve, and only then will the funds become available to send.
In your RPC results you can clearly see pieces of information:
...
"funding": {
"local_funds_msat": 0,
"remote_funds_msat": 16777215000,
"pushed_msat": 0
},
"to_us_msat": 123456789,
"min_to_us_msat": 0,
"max_to_us_msat": 123456789,
...
"their_reserve_msat": 167772000,
"our_reserve_msat": 167772000,
"spendable_msat": 0,
"receivable_msat": 16481680211,
This is all from the merchant side, and we can deduce that:
reserve
with 0msat
funding amount.spendable_msat
and receivable_msat
telling you how much you can send and receive, taking into consideration the reserve
and an eventual commitment fee (which is paid only by the funder, not the fundee).That make sense, thanks a lot! That explain why things start working when I ran the test twice!
So, I have connected two nodes on regtest,
customer
andmerchant
.customer
established the channel tomerchant
and successfully pushed a payment to merchant.merchant
is unable to send back (the situation unlock itself later on, though I haven't identified what fix it)Customer getinfo:
Merchant
getinfo
:Merchant
listpeerchannels
:As you can see, the channel is local and seems in a good state.
Now, merchant tries to pay the invoice issued by customer
lnbcrt1u1pn3r7cssp5xmy48dxg5pwrdrj7pyctlcezcxm53z6qsxgdz58m7md84smyc6espp585rmft0kypuc0d4vj3hvqj6xd9cwlete5du2squ6p4qmr84lz0cqdp6vcurjwryxdjrxttz8qukvtf5xccxztfc8psngtf4xfskxepcv4jk2enrvyxq9rf0qqcqp29qxpqysgqw32nlmcr0y5t5ekdnzy5e57d6vw7tjz58y6s25pkl8es0krs9l88j7lnp8hypm5nr2pgepqvt7ke4gtm2v2fx07wlvcth4tqed9549cqtdn897
.The following decode:
When the merchant pay, it fails:
Here are the logs of the merchant:
It seems the
estimated capacity
is incorrectly set for routing purpose. How can I fix this?The merchant settings are:
Version: btcpayserver/lightning:v24.05