2021-11-26 16:03:00 -08:00
|
|
|
//go:build peersrpc
|
|
|
|
// +build peersrpc
|
|
|
|
|
|
|
|
package peersrpc
|
|
|
|
|
2021-12-05 20:24:06 -08:00
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
|
|
|
|
"github.com/lightningnetwork/lnd/lnwire"
|
|
|
|
"github.com/lightningnetwork/lnd/netann"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Config is the primary configuration struct for the peers RPC subserver.
|
|
|
|
// It contains all the items required for the server to carry out its duties.
|
|
|
|
// The fields with struct tags are meant to be parsed as normal configuration
|
|
|
|
// options, while if able to be populated, the latter fields MUST also be
|
|
|
|
// specified.
|
|
|
|
type Config struct {
|
|
|
|
// GetNodeAnnouncement is used to send our retrieve the current
|
|
|
|
// node announcement information.
|
2023-04-05 10:21:59 +02:00
|
|
|
GetNodeAnnouncement func() lnwire.NodeAnnouncement
|
2021-12-05 20:24:06 -08:00
|
|
|
|
|
|
|
// ParseAddr parses an address from its string format to a net.Addr.
|
|
|
|
ParseAddr func(addr string) (net.Addr, error)
|
|
|
|
|
2023-04-03 11:27:14 +02:00
|
|
|
// UpdateNodeAnnouncement updates and broadcasts our node announcement,
|
|
|
|
// setting the feature vector provided and applying the
|
|
|
|
// NodeAnnModifiers. If no feature updates are required, a nil feature
|
|
|
|
// vector should be provided.
|
|
|
|
UpdateNodeAnnouncement func(features *lnwire.RawFeatureVector,
|
|
|
|
mods ...netann.NodeAnnModifier) error
|
2021-12-05 20:24:06 -08:00
|
|
|
}
|