mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
autopilot: start threading contexts through
The `GraphSource` interface in the `autopilot` package is directly implemented by the `graphdb.KVStore` and so we will eventually thread contexts through to this interface. So in this commit, we start updating the autopilot system to thread contexts through in preparation for passing the context through to any calls made to the GraphSource. Two context.TODOs are added here which will be addressed in follow up commits.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package autopilot
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
@@ -35,7 +36,8 @@ type Node interface {
|
||||
// iterate through all edges emanating from/to the target node. For
|
||||
// each active channel, this function should be called with the
|
||||
// populated ChannelEdge that describes the active channel.
|
||||
ForEachChannel(func(ChannelEdge) error) error
|
||||
ForEachChannel(context.Context, func(context.Context,
|
||||
ChannelEdge) error) error
|
||||
}
|
||||
|
||||
// LocalChannel is a simple struct which contains relevant details of a
|
||||
@@ -83,7 +85,7 @@ type ChannelGraph interface {
|
||||
// ForEachNode is a higher-order function that should be called once
|
||||
// for each connected node within the channel graph. If the passed
|
||||
// callback returns an error, then execution should be terminated.
|
||||
ForEachNode(func(Node) error) error
|
||||
ForEachNode(context.Context, func(context.Context, Node) error) error
|
||||
}
|
||||
|
||||
// NodeScore is a tuple mapping a NodeID to a score indicating the preference
|
||||
|
Reference in New Issue
Block a user