Merge pull request #9383 from ziggie1984/bugfix-createmissingedge

bugfix createmissingedge
This commit is contained in:
Yong 2025-01-14 16:20:15 +08:00 committed by GitHub
commit 4b16c2902e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -311,8 +311,16 @@ func (r *Manager) createEdge(channel *channeldb.OpenChannel,
err)
}
// We need to make sure we use the real scid for public confirmed
// zero-conf channels.
shortChanID := channel.ShortChanID()
isPublic := channel.ChannelFlags&lnwire.FFAnnounceChannel != 0
if isPublic && channel.IsZeroConf() && channel.ZeroConfConfirmed() {
shortChanID = channel.ZeroConfRealScid()
}
info := &models.ChannelEdgeInfo{
ChannelID: channel.ShortChanID().ToUint64(),
ChannelID: shortChanID.ToUint64(),
ChainHash: channel.ChainHash,
Features: featureBuf.Bytes(),
Capacity: channel.Capacity,
@ -328,7 +336,7 @@ func (r *Manager) createEdge(channel *channeldb.OpenChannel,
// be updated with the new values in the call to processChan below.
timeLockDelta := uint16(r.DefaultRoutingPolicy.TimeLockDelta)
edge := &models.ChannelEdgePolicy{
ChannelID: channel.ShortChanID().ToUint64(),
ChannelID: shortChanID.ToUint64(),
LastUpdate: timestamp,
TimeLockDelta: timeLockDelta,
ChannelFlags: channelFlags,