@@ -865,15 +865,15 @@ func (b *Builder) updateGraphWithClosedChannels(
865865// timestamp. ErrIgnored will be returned if we already have the node, and
866866// ErrOutdated will be returned if we have a timestamp that's after the new
867867// timestamp.
868- func (b * Builder ) assertNodeAnnFreshness (node route.Vertex ,
868+ func (b * Builder ) assertNodeAnnFreshness (ctx context. Context , node route.Vertex ,
869869 msgTimestamp time.Time ) error {
870870
871871 // If we are not already aware of this node, it means that we don't
872872 // know about any channel using this node. To avoid a DoS attack by
873873 // node announcements, we will ignore such nodes. If we do know about
874874 // this node, check that this update brings info newer than what we
875875 // already have.
876- lastUpdate , exists , err := b .cfg .Graph .HasLightningNode (node )
876+ lastUpdate , exists , err := b .cfg .Graph .HasLightningNode (ctx , node )
877877 if err != nil {
878878 return errors .Errorf ("unable to query for the " +
879879 "existence of node: %v" , err )
@@ -996,7 +996,7 @@ func (b *Builder) addNode(ctx context.Context, node *models.LightningNode,
996996 // Before we add the node to the database, we'll check to see if the
997997 // announcement is "fresh" or not. If it isn't, then we'll return an
998998 // error.
999- err := b .assertNodeAnnFreshness (node .PubKeyBytes , node .LastUpdate )
999+ err := b .assertNodeAnnFreshness (ctx , node .PubKeyBytes , node .LastUpdate )
10001000 if err != nil {
10011001 return err
10021002 }
@@ -1306,12 +1306,12 @@ func (b *Builder) AddProof(chanID lnwire.ShortChannelID,
13061306// target node with a more recent timestamp.
13071307//
13081308// NOTE: This method is part of the ChannelGraphSource interface.
1309- func (b * Builder ) IsStaleNode (node route.Vertex ,
1309+ func (b * Builder ) IsStaleNode (ctx context. Context , node route.Vertex ,
13101310 timestamp time.Time ) bool {
13111311
13121312 // If our attempt to assert that the node announcement is fresh fails,
13131313 // then we know that this is actually a stale announcement.
1314- err := b .assertNodeAnnFreshness (node , timestamp )
1314+ err := b .assertNodeAnnFreshness (ctx , node , timestamp )
13151315 if err != nil {
13161316 log .Debugf ("Checking stale node %x got %v" , node , err )
13171317 return true
0 commit comments