mirror of
https://github.com/ACINQ/eclair.git
synced 2025-02-24 22:58:23 +01:00
Add workaround for lnd sync issue (#1563)
When a channel gets confirmed while nodes are disconnected, recent lnd nodes sometimes fail to send their channel_reestablish message and instead send a funding_locked first (due to a race condition on their side). When that happened, the channel stayed stuck in the SYNCING state. To avoid that, we trigger a reconnection until the race condition is eventually won by the channel_reestablish.
This commit is contained in:
parent
f9ff586cba
commit
131b2e01c5
1 changed files with 9 additions and 0 deletions
|
@ -1598,6 +1598,15 @@ class Channel(val nodeParams: NodeParams, val wallet: EclairWallet, remoteNodeId
|
||||||
goto(NEGOTIATING) using d.copy(closingTxProposed = closingTxProposed1) sending d.localShutdown
|
goto(NEGOTIATING) using d.copy(closingTxProposed = closingTxProposed1) sending d.localShutdown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This handler is a workaround for an issue in lnd: starting with versions 0.10 / 0.11, they sometimes fail to send
|
||||||
|
// a channel_reestablish when reconnecting a channel that recently got confirmed, and instead send a funding_locked
|
||||||
|
// first and then go silent. This is due to a race condition on their side, so we trigger a reconnection, hoping that
|
||||||
|
// we will eventually receive their channel_reestablish.
|
||||||
|
case Event(_: FundingLocked, _) =>
|
||||||
|
log.warning("received funding_locked before channel_reestablish (known lnd bug): disconnecting...")
|
||||||
|
peer ! Peer.Disconnect(remoteNodeId)
|
||||||
|
stay
|
||||||
|
|
||||||
case Event(c: CurrentBlockCount, d: HasCommitments) => handleNewBlock(c, d)
|
case Event(c: CurrentBlockCount, d: HasCommitments) => handleNewBlock(c, d)
|
||||||
|
|
||||||
case Event(c: CurrentFeerates, d: HasCommitments) =>
|
case Event(c: CurrentFeerates, d: HasCommitments) =>
|
||||||
|
|
Loading…
Add table
Reference in a new issue