graph/db: thread context to AddLightningNode
This commit is contained in:
15 files changed
+126
-81
No files matched your search
@@ -2022,7 +2022,7 @@ func (d *AuthenticatedGossiper) fetchPKScript(chanID *lnwire.ShortChannelID) (
|
||||
|
||||
// addNode processes the given node announcement, and adds it to our channel
|
||||
// graph.
|
||||
func (d *AuthenticatedGossiper) addNode(_ context.Context,
|
||||
func (d *AuthenticatedGossiper) addNode(ctx context.Context,
|
||||
msg *lnwire.NodeAnnouncement, op ...batch.SchedulerOption) error {
|
||||
|
||||
if err := netann.ValidateNodeAnn(msg); err != nil {
|
||||
@@ -2030,7 +2030,9 @@ func (d *AuthenticatedGossiper) addNode(_ context.Context,
|
||||
err)
|
||||
}
|
||||
|
||||
return d.cfg.Graph.AddNode(models.NodeFromWireAnnouncement(msg), op...)
|
||||
return d.cfg.Graph.AddNode(
|
||||
ctx, models.NodeFromWireAnnouncement(msg), op...,
|
||||
)
|
||||
}
|
||||
|
||||
// isPremature decides whether a given network message has a block height+delta
|
||||
|
||||
@@ -109,7 +109,7 @@ func newMockRouter(t *testing.T, height uint32) *mockGraphSource {
|
||||
|
||||
var _ graph.ChannelGraphSource = (*mockGraphSource)(nil)
|
||||
|
||||
func (r *mockGraphSource) AddNode(node *models.LightningNode,
|
||||
func (r *mockGraphSource) AddNode(_ context.Context, node *models.LightningNode,
|
||||
_ ...batch.SchedulerOption) error {
|
||||
|
||||
r.mu.Lock()
|
||||
|
||||
Reference in new issue
Block a user