mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-03 03:53:10 +02:00
lnrpc/peers: skeleton logic for updateNodeAnnouncement
Basic logic for the endpoint: - Get the current nodeAnn information - Calculate modifications - Apply modifications - Return changes
This commit is contained in:
12
rpcserver.go
12
rpcserver.go
@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"net"
|
||||
"net/http"
|
||||
"runtime"
|
||||
"sort"
|
||||
@ -729,6 +730,14 @@ func (r *rpcServer) addDeps(s *server, macService *macaroons.Service,
|
||||
return s.featureMgr.Get(feature.SetInvoiceAmp)
|
||||
}
|
||||
|
||||
getNodeAnnouncement := func() (lnwire.NodeAnnouncement, error) {
|
||||
return s.genNodeAnnouncement(false)
|
||||
}
|
||||
|
||||
parseAddr := func(addr string) (net.Addr, error) {
|
||||
return parseAddr(addr, r.cfg.net)
|
||||
}
|
||||
|
||||
var (
|
||||
subServers []lnrpc.SubServer
|
||||
subServerPerms []lnrpc.MacaroonPerms
|
||||
@ -745,7 +754,8 @@ func (r *rpcServer) addDeps(s *server, macService *macaroons.Service,
|
||||
routerBackend, s.nodeSigner, s.graphDB, s.chanStateDB,
|
||||
s.sweeper, tower, s.towerClient, s.anchorTowerClient,
|
||||
r.cfg.net.ResolveTCPAddr, genInvoiceFeatures,
|
||||
genAmpInvoiceFeatures, rpcsLog,
|
||||
genAmpInvoiceFeatures, getNodeAnnouncement,
|
||||
s.updateAndBrodcastSelfNode, parseAddr, rpcsLog,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user