mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 07:00:55 +02:00
chainio: use package logger instead of instance logger
There's no guarantee that the `b.beat` is initialized when the dispatcher shuts down, especially with the case in the remote signer where no chainbackend is created.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
ff6ea786ec
commit
6bf9a38940
@@ -135,6 +135,14 @@ func (b *BlockbeatDispatcher) Stop() {
|
||||
}
|
||||
|
||||
func (b *BlockbeatDispatcher) log() btclog.Logger {
|
||||
// There's no guarantee that the `b.beat` is initialized when the
|
||||
// dispatcher shuts down, especially in the case where the node is
|
||||
// running as a remote signer, which doesn't have a chainbackend. In
|
||||
// that case we will use the package logger.
|
||||
if b.beat == nil {
|
||||
return clog
|
||||
}
|
||||
|
||||
return b.beat.logger()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user