server: start htlcSwitch before chainArb

This commit is contained in:
yyforyongyu 2022-01-30 12:14:37 +08:00
parent 1aaa1d89bb
commit 72548ea463
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868
2 changed files with 13 additions and 6 deletions

View File

@ -36,6 +36,10 @@
could result in an "invoice too large" error when creating invoices. Hints
are now properly limited to our maximum of 20.
* [Fixed an edge case where the lnd might be stuck at starting due to channel
arbitrator relying on htlcswitch to be started
first](https://github.com/lightningnetwork/lnd/pull/6214).
## Misc
* [An example systemd service file](https://github.com/lightningnetwork/lnd/pull/6033)

View File

@ -1777,6 +1777,15 @@ func (s *server) Start() error {
}
cleanup = cleanup.add(s.fundingMgr.Stop)
// htlcSwitch must be started before chainArb since the latter
// relies on htlcSwitch to deliver resolution message upon
// start.
if err := s.htlcSwitch.Start(); err != nil {
startErr = err
return
}
cleanup = cleanup.add(s.htlcSwitch.Stop)
if err := s.chainArb.Start(); err != nil {
startErr = err
return
@ -1807,12 +1816,6 @@ func (s *server) Start() error {
}
cleanup = cleanup.add(s.sphinx.Stop)
if err := s.htlcSwitch.Start(); err != nil {
startErr = err
return
}
cleanup = cleanup.add(s.htlcSwitch.Stop)
if err := s.chanStatusMgr.Start(); err != nil {
startErr = err
return