Versions in this module Expand all Collapse all v1 v1.0.0 May 10, 2019 Changes in this version + var AvailableHeuristics = make(map[string]AttachmentHeuristic) + var ErrNoPositive = errors.New("no positive weights left") + func DisableLog() + func Median(vals []btcutil.Amount) btcutil.Amount + func UseLogger(logger btclog.Logger) + type Agent struct + func New(cfg Config, initialState []Channel) (*Agent, error) + func (a *Agent) OnBalanceChange() + func (a *Agent) OnChannelClose(closedChans ...lnwire.ShortChannelID) + func (a *Agent) OnChannelOpen(c Channel) + func (a *Agent) OnChannelOpenFailure() + func (a *Agent) OnChannelPendingOpen() + func (a *Agent) OnNodeUpdates() + func (a *Agent) Start() error + func (a *Agent) Stop() error + type AgentConstraints interface + ChannelBudget func(chans []Channel, balance btcutil.Amount) (btcutil.Amount, uint32) + MaxChanSize func() btcutil.Amount + MaxPendingOpens func() uint16 + MinChanSize func() btcutil.Amount + func NewConstraints(minChanSize, maxChanSize btcutil.Amount, chanLimit, maxPendingOpens uint16, ...) AgentConstraints + type AttachmentDirective struct + Addrs []net.Addr + ChanAmt btcutil.Amount + NodeID NodeID + type AttachmentHeuristic interface + Name func() string + NodeScores func(g ChannelGraph, chans []Channel, chanSize btcutil.Amount, ...) (map[NodeID]*NodeScore, error) + type Channel struct + Capacity btcutil.Amount + ChanID lnwire.ShortChannelID + FundedAmt btcutil.Amount + Node NodeID + type ChannelController interface + CloseChannel func(chanPoint *wire.OutPoint) error + OpenChannel func(target *btcec.PublicKey, amt btcutil.Amount) error + SpliceIn func(chanPoint *wire.OutPoint, amt btcutil.Amount) (*Channel, error) + SpliceOut func(chanPoint *wire.OutPoint, amt btcutil.Amount) (*Channel, error) + type ChannelEdge struct + Peer Node + type ChannelGraph interface + ForEachNode func(func(Node) error) error + func ChannelGraphFromDatabase(db *channeldb.ChannelGraph) ChannelGraph + type Config struct + ChanController ChannelController + ConnectToPeer func(*btcec.PublicKey, []net.Addr) (bool, error) + Constraints AgentConstraints + DisconnectPeer func(*btcec.PublicKey) error + Graph ChannelGraph + Heuristic AttachmentHeuristic + Self *btcec.PublicKey + WalletBalance func() (btcutil.Amount, error) + type ExternalScoreAttachment struct + func NewExternalScoreAttachment() *ExternalScoreAttachment + func (s *ExternalScoreAttachment) Name() string + func (s *ExternalScoreAttachment) NodeScores(g ChannelGraph, chans []Channel, chanSize btcutil.Amount, ...) (map[NodeID]*NodeScore, error) + func (s *ExternalScoreAttachment) SetNodeScores(targetHeuristic string, newScores map[NodeID]float64) (bool, error) + type HeuristicScores map[string]map[NodeID]float64 + type Manager struct + func NewManager(cfg *ManagerCfg) (*Manager, error) + func (m *Manager) IsActive() bool + func (m *Manager) QueryHeuristics(nodes []NodeID, localState bool) (HeuristicScores, error) + func (m *Manager) SetNodeScores(name string, scores map[NodeID]float64) error + func (m *Manager) Start() error + func (m *Manager) StartAgent() error + func (m *Manager) Stop() error + func (m *Manager) StopAgent() error + type ManagerCfg struct + ChannelState func() ([]Channel, error) + PilotCfg *Config + Self *btcec.PublicKey + SubscribeTopology func() (*routing.TopologyClient, error) + SubscribeTransactions func() (lnwallet.TransactionSubscription, error) + type Node interface + Addrs func() []net.Addr + ForEachChannel func(func(ChannelEdge) error) error + PubKey func() [33]byte + type NodeID [33]byte + func NewNodeID(pub *btcec.PublicKey) NodeID + type NodeScore struct + NodeID NodeID + Score float64 + type PrefAttachment struct + func NewPrefAttachment() *PrefAttachment + func (p *PrefAttachment) Name() string + func (p *PrefAttachment) NodeScores(g ChannelGraph, chans []Channel, chanSize btcutil.Amount, ...) (map[NodeID]*NodeScore, error) + type ScoreSettable interface + SetNodeScores func(string, map[NodeID]float64) (bool, error) + type WeightedCombAttachment struct + func NewWeightedCombAttachment(h ...*WeightedHeuristic) (*WeightedCombAttachment, error) + func (c *WeightedCombAttachment) Name() string + func (c *WeightedCombAttachment) NodeScores(g ChannelGraph, chans []Channel, chanSize btcutil.Amount, ...) (map[NodeID]*NodeScore, error) + func (c *WeightedCombAttachment) SetNodeScores(targetHeuristic string, newScores map[NodeID]float64) (bool, error) + type WeightedHeuristic struct + Weight float64