multi: add NewLogClosure in lnutils to avoid repetition

And replaces all usage of `logClosure` with `lnutils.LogClosure`.
This commit is contained in:
yyforyongyu
2024-07-24 19:31:21 +08:00
parent 7e60d41898
commit b6049ff94b
38 changed files with 103 additions and 299 deletions

View File

@@ -13,6 +13,7 @@ import (
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/fn"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/lnutils"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
)
@@ -1376,7 +1377,7 @@ func (s *UtxoSweeper) handleInputSpent(spend *chainntnfs.SpendDetail) {
log.Debugf("Detected third party spend related to in flight "+
"inputs (is_ours=%v): %v", isOurTx,
newLogClosure(func() string {
lnutils.NewLogClosure(func() string {
return spew.Sdump(spend.SpendingTx)
}),
)