graph/db: thread context through to UpdateEdgePolicy
This commit is contained in:
15 files changed
+94
-86
No files matched your search
@@ -2288,7 +2288,7 @@ func (d *AuthenticatedGossiper) isMsgStale(_ context.Context,
|
||||
|
||||
// updateChannel creates a new fully signed update for the channel, and updates
|
||||
// the underlying graph with the new state.
|
||||
func (d *AuthenticatedGossiper) updateChannel(_ context.Context,
|
||||
func (d *AuthenticatedGossiper) updateChannel(ctx context.Context,
|
||||
info *models.ChannelEdgeInfo,
|
||||
edge *models.ChannelEdgePolicy) (*lnwire.ChannelAnnouncement1,
|
||||
*lnwire.ChannelUpdate1, error) {
|
||||
@@ -2322,7 +2322,7 @@ func (d *AuthenticatedGossiper) updateChannel(_ context.Context,
|
||||
}
|
||||
|
||||
// Finally, we'll write the new edge policy to disk.
|
||||
if err := d.cfg.Graph.UpdateEdge(edge); err != nil {
|
||||
if err := d.cfg.Graph.UpdateEdge(ctx, edge); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
@@ -3263,7 +3263,7 @@ func (d *AuthenticatedGossiper) handleChanUpdate(ctx context.Context,
|
||||
ExtraOpaqueData: upd.ExtraOpaqueData,
|
||||
}
|
||||
|
||||
if err := d.cfg.Graph.UpdateEdge(update, ops...); err != nil {
|
||||
if err := d.cfg.Graph.UpdateEdge(ctx, update, ops...); err != nil {
|
||||
if graph.IsError(
|
||||
err, graph.ErrOutdated,
|
||||
graph.ErrIgnored,
|
||||
|
||||
@@ -161,8 +161,8 @@ func (r *mockGraphSource) queueValidationFail(chanID uint64) {
|
||||
r.chansToReject[chanID] = struct{}{}
|
||||
}
|
||||
|
||||
func (r *mockGraphSource) UpdateEdge(edge *models.ChannelEdgePolicy,
|
||||
_ ...batch.SchedulerOption) error {
|
||||
func (r *mockGraphSource) UpdateEdge(_ context.Context,
|
||||
edge *models.ChannelEdgePolicy, _ ...batch.SchedulerOption) error {
|
||||
|
||||
r.mu.Lock()
|
||||
defer func() {
|
||||
|
||||
Reference in new issue
Block a user