lnd: pass context to newServer and server.Start

In preparation for starting to thread a single parent context through
LND, we update the main `server.Start` method to take a context so that
it can later pass it to any subsytem's Start method it calls. We also
pass the context to `newServer` since it makes some calls that will
eventually reach the DB (for example the graph db).
This commit is contained in:
Elle Mouton committed 2025-05-22 14:14:36 +02:00
1 parent 6ff0c85d76
commit 53ba229436
2 files changed
+6 -4

No files matched your search

+4 -2
View File
@@ -554,7 +554,9 @@ func noiseDial(idKey keychain.SingleKeyECDH,
// newServer creates a new instance of the server which is to listen using the
// passed listener address.
func newServer(cfg *Config, listenAddrs []net.Addr,
//
//nolint:funlen
func newServer(_ context.Context, cfg *Config, listenAddrs []net.Addr,
dbs *DatabaseInstances, cc *chainreg.ChainControl,
nodeKeyDesc *keychain.KeyDescriptor,
chansToRestore walletunlocker.ChannelsToRecover,
@@ -2217,7 +2219,7 @@ func (s *server) startLowLevelServices() error {
// NOTE: This function is safe for concurrent access.
//
//nolint:funlen
func (s *server) Start() error {
func (s *server) Start(_ context.Context) error {
// Get the current blockbeat.
beat, err := s.getStartingBeat()
if err != nil {