mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-28 07:46:52 +02:00
funding+htlcswitch: dynamically update short chan id of existing link
In this commit, we fix an existing bug that would result in some payments getting “stuck”. This would happen if one side restarted before the channel was fully locked in. In this case, since upon re-connection, the link will get added to the switch with a *short channel ID of zero*. If A then tries to make a multi-hop payment through B, B will fail to forward the payment, as it’ll mistakenly think that the payment originated from a local-subsystem as the channel ID is zero. A short channel ID of zero is used to map local payments back to their caller. With fix this by allowing the funding manager to dynamically update the short channel ID of a link after it discovers the short channel ID. In this commit, we fix a second instance of reported “stuck” payments by users.
This commit is contained in:
@@ -65,6 +65,12 @@ type ChannelLink interface {
|
||||
// the original funding output can be found.
|
||||
ShortChanID() lnwire.ShortChannelID
|
||||
|
||||
// UpdateShortChanID updates the short channel ID for a link. This may
|
||||
// be required in the event that a link is created before the short
|
||||
// chan ID for it is known, or a re-org occurs, and the funding
|
||||
// transacton changes location within the chain.
|
||||
UpdateShortChanID(lnwire.ShortChannelID)
|
||||
|
||||
// UpdateForwardingPolicy updates the forwarding policy for the target
|
||||
// ChannelLink. Once updated, the link will use the new forwarding
|
||||
// policy to govern if it an incoming HTLC should be forwarded or not.
|
||||
|
Reference in New Issue
Block a user