mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-03 01:21:40 +01:00
multi: move bandwidth hints behind interface
This commit is contained in:
@@ -19,12 +19,12 @@ type SessionSource struct {
|
||||
// and also to carry out path finding queries.
|
||||
Graph routingGraph
|
||||
|
||||
// QueryBandwidth is a method that allows querying the lower link layer
|
||||
// GetLink is a method that allows querying the lower link layer
|
||||
// to determine the up to date available bandwidth at a prospective link
|
||||
// to be traversed. If the link isn't available, then a value of zero
|
||||
// should be returned. Otherwise, the current up to date knowledge of
|
||||
// the available bandwidth of the link should be returned.
|
||||
QueryBandwidth func(*channeldb.DirectedChannel) lnwire.MilliSatoshi
|
||||
GetLink getLinkQuery
|
||||
|
||||
// MissionControl is a shared memory of sorts that executions of payment
|
||||
// path finding use in order to remember which vertexes/edges were
|
||||
@@ -47,12 +47,10 @@ type SessionSource struct {
|
||||
func (m *SessionSource) NewPaymentSession(p *LightningPayment) (
|
||||
PaymentSession, error) {
|
||||
|
||||
getBandwidthHints := func() (map[uint64]lnwire.MilliSatoshi,
|
||||
error) {
|
||||
sourceNode := m.Graph.sourceNode()
|
||||
|
||||
return generateBandwidthHints(
|
||||
m.Graph.sourceNode(), m.Graph, m.QueryBandwidth,
|
||||
)
|
||||
getBandwidthHints := func() (bandwidthHints, error) {
|
||||
return newBandwidthManager(m.Graph, sourceNode, m.GetLink)
|
||||
}
|
||||
|
||||
session, err := newPaymentSession(
|
||||
|
||||
Reference in New Issue
Block a user