discovery: only interpret remote announcements as pre-mature
This commit fixes a slight bug in the announcement processing logic within the AuthenticatedGossiper. Before this commit, it was possible for us to ignore one of our now announcements due to it being pre-mature, rendering (atm) the channel unusable by the ChannelRouter itself. To fix this, we know only check for a pre mature announcement iff the message is coming from a remote node.
This commit is contained in:
parent
f3b8c912b4
commit
03f9479eb4
@ -382,7 +382,9 @@ func (d *AuthenticatedGossiper) networkHandler() {
|
|||||||
// this is either a new announcement from our PoV or an
|
// this is either a new announcement from our PoV or an
|
||||||
// edges to a prior vertex/edge we previously
|
// edges to a prior vertex/edge we previously
|
||||||
// proceeded.
|
// proceeded.
|
||||||
emittedAnnouncements := d.processNetworkAnnouncement(announcement)
|
emittedAnnouncements := d.processNetworkAnnouncement(
|
||||||
|
announcement,
|
||||||
|
)
|
||||||
|
|
||||||
// If the announcement was accepted, then add the
|
// If the announcement was accepted, then add the
|
||||||
// emitted announcements to our announce batch to be
|
// emitted announcements to our announce batch to be
|
||||||
@ -693,7 +695,7 @@ func (d *AuthenticatedGossiper) processNetworkAnnouncement(nMsg *networkMsg) []l
|
|||||||
// If the advertised inclusionary block is beyond our knowledge
|
// If the advertised inclusionary block is beyond our knowledge
|
||||||
// of the chain tip, then we'll put the announcement in limbo
|
// of the chain tip, then we'll put the announcement in limbo
|
||||||
// to be fully verified once we advance forward in the chain.
|
// to be fully verified once we advance forward in the chain.
|
||||||
if isPremature(msg.ShortChannelID, 0) {
|
if nMsg.isRemote && isPremature(msg.ShortChannelID, 0) {
|
||||||
blockHeight := msg.ShortChannelID.BlockHeight
|
blockHeight := msg.ShortChannelID.BlockHeight
|
||||||
log.Infof("Announcement for chan_id=(%v), is premature: "+
|
log.Infof("Announcement for chan_id=(%v), is premature: "+
|
||||||
"advertises height %v, only height %v is known",
|
"advertises height %v, only height %v is known",
|
||||||
@ -800,7 +802,7 @@ func (d *AuthenticatedGossiper) processNetworkAnnouncement(nMsg *networkMsg) []l
|
|||||||
// If the advertised inclusionary block is beyond our knowledge
|
// If the advertised inclusionary block is beyond our knowledge
|
||||||
// of the chain tip, then we'll put the announcement in limbo
|
// of the chain tip, then we'll put the announcement in limbo
|
||||||
// to be fully verified once we advance forward in the chain.
|
// to be fully verified once we advance forward in the chain.
|
||||||
if isPremature(msg.ShortChannelID, 0) {
|
if nMsg.isRemote && isPremature(msg.ShortChannelID, 0) {
|
||||||
log.Infof("Update announcement for "+
|
log.Infof("Update announcement for "+
|
||||||
"short_chan_id(%v), is premature: advertises "+
|
"short_chan_id(%v), is premature: advertises "+
|
||||||
"height %v, only height %v is known",
|
"height %v, only height %v is known",
|
||||||
|
Loading…
Reference in New Issue
Block a user