Closed PsySc0rpi0n closed 3 years ago
Note that we do not actually support self-paying via pay
... previous versions did an early-out success (we are paying ourself, so the most logical thing to do is... not spend on fees to send a payment to ourself), probably we need to reimplement that. Instead, consider something from plugins or look into CLBOSS for automatic management.
The crashing line is:
Which occurs because we are apparently generating a route that gives negative fees:
Below is the decodepay
of your invoice:
{
"currency": "bc",
"created_at": 1611185549,
"expiry": 604800,
"payee": "03fef777d58a529df02a3fb267690e0c9033767b555cc1c63844bb2d3498789f91",
"msatoshi": 985000000,
"amount_msat": "985000000msat",
"description": "Rebalancing_boltx_cahnnel",
"min_final_cltv_expiry": 18,
"payment_secret": "6abe4211afc8145f7bf303d3452898b5f0a6f326e982208904c033673809f351",
"features": "028200",
"routes": [
[
{
"pubkey": "026165850492521f4ac8abd9bd8088123446d126f648ca35e60f88177dc149ceb2",
"short_channel_id": "665969x1380x0",
"fee_base_msat": 1000,
"fee_proportional_millionths": 1,
"cltv_expiry_delta": 40
}
]
],
"payment_hash": "2e3678e78eccc3be3d5061a8bdc21b503a28f8faa89bff8df0da026adfbfca8f",
"signature": "3045022100a745e28059fbbff9ed764d7e70a0e6b5f3f09b72d08abc042d50d8f21106a3cf02206f53dd1c8f55bfa328c90dd48c720c92009ffd9032ea9ff855aa83f4bfc543eb"
}
So there is a routehint from 026165850492521f4ac8abd9bd8088123446d126f648ca35e60f88177dc149ceb2
to your node, which makes sense. Not sure what is causing the negative fees though.
@ZmnSCPxj, @darosior told me in IRC that self-payments are supported... Do we or do we not support them? I'm confused.
Strictly speaking we support paying to ourselves, we just won't create a circular route for it in pay
/ gossipd
, which I think leads to a 0-hop route, which then crashes in the pay
plugin. I'll take a look at it.
Yes, a 0-hop route will end up failing here:
@cdecker, so for now, it will not be possible to perform the rebalancing using this circular payment technique for now, right?
@PsySc0rpi0n: You might want to use the rebalance plugin rather than attempting to implement rebalancing yourself manually.
@PsySc0rpi0n: You might want to use the rebalance plugin rather than attempting to implement rebalancing yourself manually.
Yes, I will try it maybe today. However I only want to balance this one channel, so I have to use the other option that gives me more control instead of rebalance all channels.
Yes, I will try it maybe today. However I only want to balance this one channel, so I have to use the other option that gives me more control instead of rebalance all channels.
You'll need to match up two channels to be rebalanced: one too much funds and another with too little, since rebalance will move funds from the over-full one to the empty one, otherwise where would the funds go to, or come from otherwise? This is what the rebalance plugin does.
Issue and Steps to Reproduce
I have one channel that needs to be rebalanced. The balance is now around 15% / 85% (Out/In) and the total capacity is around 1.5 million sats. 1.4 million sats is now inbound capacity. So I tried to create an invoice with 985k sats (because I have another channel with 100% Incoming capacity of 1 million sats, minus reserves and fees) to try to send them through this channel and the logs says the follwoing:
getinfo
outputChannel needing rebalancing:
Channel I was trying to use to send the funds for the rebalancing:
The invoice I created: