routing: add TlvTrafficShaper to bandwidth hints
This commit is contained in:
1 parent
5dcda25881
commit
5b4de5f0d4
12 files changed
+314
-43
No files matched your search
@@ -4,8 +4,10 @@ import (
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/channeldb/models"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/routing/route"
|
||||
"github.com/lightningnetwork/lnd/tlv"
|
||||
"github.com/lightningnetwork/lnd/zpay32"
|
||||
)
|
||||
|
||||
@@ -49,12 +51,14 @@ type SessionSource struct {
|
||||
// view from Mission Control. An optional set of routing hints can be provided
|
||||
// in order to populate additional edges to explore when finding a path to the
|
||||
// payment's destination.
|
||||
func (m *SessionSource) NewPaymentSession(p *LightningPayment) (
|
||||
PaymentSession, error) {
|
||||
func (m *SessionSource) NewPaymentSession(p *LightningPayment,
|
||||
firstHopBlob fn.Option[tlv.Blob],
|
||||
trafficShaper fn.Option[TlvTrafficShaper]) (PaymentSession, error) {
|
||||
|
||||
getBandwidthHints := func(graph Graph) (bandwidthHints, error) {
|
||||
return newBandwidthManager(
|
||||
graph, m.SourceNode.PubKeyBytes, m.GetLink,
|
||||
firstHopBlob, trafficShaper,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user