multi: add SpewLogClosure to avoid code repetition

This commit is contained in:
yyforyongyu committed 2024-07-25 22:18:49 +08:00
1 parent b6049ff94b
commit d992cf94d6
19 files changed
+57 -144

No files matched your search

+3 -8
View File
@@ -13,7 +13,6 @@ import (
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btclog"
"github.com/davecgh/go-spew/spew"
"github.com/go-errors/errors"
"github.com/lightningnetwork/lnd/build"
"github.com/lightningnetwork/lnd/channeldb"
@@ -2537,13 +2536,9 @@ func (l *channelLink) updateCommitTx() error {
l.log.Tracef("revocation window exhausted, unable to send: "+
"%v, pend_updates=%v, dangling_closes%v",
l.channel.PendingLocalUpdateCount(),
lnutils.NewLogClosure(func() string {
return spew.Sdump(l.openedCircuits)
}),
lnutils.NewLogClosure(func() string {
return spew.Sdump(l.closedCircuits)
}),
)
lnutils.SpewLogClosure(l.openedCircuits),
lnutils.SpewLogClosure(l.closedCircuits))
return nil
} else if err != nil {
return err