-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remote node returns error about exceeding max pending channels while no pending channels #2217
Comments
Who initiated the last channel between y'all? Has 288 blocks passed since that channel was created? If the funding transaction was never broadcast, then the responder will forget the channel. However, we don't as the initiator, since we need to double-spend the inputs used in order to invalidate the original funding transaction. Related to #386 |
Considering our wallet issues in the past, I'd say it's more likely that the funding transaction is invalid by attempting to double spend an input. This is something that we don't currently detect at the moment. If this is the case, I would suggest using the note added: |
Unless I'm mistaken the ghost channel was initiated from the OpenNode side and the final channel (which is fine and still active) was also initiated from OpenNode. Also it's been more than 288 blocks since any of the channels were created. Here's the full history of the closed channels my node has involving OpenNode.
I don't see the ghost channel on the closedchannels probably because force-closing those isn't fully successfully so they are not recorded. When OpenNode force-closed the ghost channel it returned the following:
Here are the logs of the OpenNode node when I try now to open the channel to them:
I shared the issue link with João who manages the OpenNode node, so he might be able to share any info you need from his side. |
I'm running on I forced closed the channel that was pending (due to spent outputs, that were fixed after I've updated to master and did a birthday rescan) and it disappeared from the list. However, my node is not accepting the party funding reserve for some reason. |
@cryptagoras in this case, it should be safe to just use the |
@wpaulino afaik we both have just the one working & active channel. The ghost channels involving our nodes are gone from pendingchannels. There were some people on IRC suggesting force-closing ghost channels, but maybe it apparently still retains some artifacts that cause the use of pending channels count. Also, Joao restarted his node after all these, which didn't help either. |
Correct. The 'bad' channels are gone. The only channel we have is active and working correctly. |
Force closing an invalid channel (due to already spent outputs) is actually not the correct thing to do here, instead the I noticed that there's a small bug that causes some channels to not show up if they never confirmed and were attempted to be force closed (like in this case). @cryptagoras and @joaodealmeida, could you both try running the following patch locally and see if the channel shows up again within index e36dcf84..60840b48 100644
--- a/channeldb/db.go
+++ b/channeldb/db.go
@@ -511,7 +511,11 @@ func fetchChannels(d *DB, pending, waitingClose bool) ([]*OpenChannel, error) {
"node_key=%x: %v", chainHash[:], k, err)
}
for _, channel := range nodeChans {
- if channel.IsPending != pending {
+ if !waitingClose && channel.IsPending != pending {
continue
}
|
@wpaulino indeed I see several more compared to pre-patch (+2
|
Cool! I'll be putting up the patch as a PR to address the cosmetic issue. As for the pending channels, there's no good way of cleaning them up at the moment. If you'd like to open more channels to @joaodealmeida, I'd suggest setting |
@wpaulino cool, btw I just saw that with the patch the two new The two claimed {
"channel": {
"remote_node_pub": "032a2d053e2f13f5d7103f8a4c561743eb1db201550c02c953ce2e51b8321f4e03",
"channel_point": "3ada56362178462bec7c96ffb8ab15d51edeedb2138a63d3011ff00244ea9658:0",
"capacity": "666000",
"local_balance": "665638",
"remote_balance": "0"
},
"closing_txid": "ef75d91390a80e626be7c562b8615b6668ea3e70363602acda23640267749ee2",
"limbo_balance": "665638",
"maturity_height": 540039,
"blocks_til_maturity": -11947,
"recovered_balance": "0",
"pending_htlcs": [
]
},
{
"channel": {
"remote_node_pub": "02fe9469e1d7da69539e365c9b2a64d277ed5589622cb314dc8b3060f3c55f79e6",
"channel_point": "d812d5fa9910cd97a4873145e9b807609debe83b4dda019482eff09d5c514f61:0",
"capacity": "1666999",
"local_balance": "1664780",
"remote_balance": "0"
},
"closing_txid": "e3f3547b3c9a296ad16c1091bbda7ce719e15fc3e193747db83368b0ab7f32df",
"limbo_balance": "1664780",
"maturity_height": 540090,
"blocks_til_maturity": -11896,
"recovered_balance": "0",
"pending_htlcs": [
]
},
|
@cryptagoras it looks like those channels have been successfully swept on-chain. If you restart your node with |
@wpaulino sure. It's a busy node so I removed quite a few parts about other channels etc. but I can provide more extensive logs if you want. When it boots:
and when shutting down the daemon it logs the following:
|
I'm not sure what's the default but I've had more than 4 pending channels, so I'm sure the limit is bigger than 1. If there's a I can't apply the patch cause it's a production environment node. |
Background
I am trying to open a channel with the OpenNode lnd node, with which I used to have a channel in the past but after some time it got forced closed for some reason.
I then discovered that there was a ghost inbound channel from OpenNode for which the TX was never broadcasted. I force-closed all of them and waited till the locktime was over.
Now when I try to open a channel with the same node I get an error about max pending channels.
I contacted the João from OpenNode and there are no pending channels with my node (meanwhile he managed to open a channel to my node just fine).
It seems like there's something got out-of-sync around the pending channels.
All this happened before both of us upgrade to 0.5.1+ so the migrations didn't help. I still get the same remote error about max pending channels.
If the issue with ghost channels (i.e. creating channels by spending already-spent outputs) is fixed, the might not happen again, but it would be nice if there was a way to fix past out-of-sync state.
Your environment
lnd
4da1c86bitcoind
0.16.3Steps to reproduce
Difficult to reproduce. Maybe, with maxpendingchannels=1, have NodeA creating somehow a ghost channel with NodeB. NodeB force-closing that ghost channel, then NodeB trying to open a channel with NodeA. (or NodeB force-closing that ghost channel as well)
lnd logs
Expected behaviour
Opening channels without faulty/ghost past channels counting as pending.
The text was updated successfully, but these errors were encountered: