lnwallet: replace spew.Sdump with lnutils.SpewLogClosure for lazy evaluation

In this commit, we replace all instances of spew.Sdump in the lnwallet
package and its subpackages with lnutils.SpewLogClosure. This change
ensures that expensive debug dump operations are only performed when the
log level actually requires them.
This commit is contained in:
Olaoluwa Osuntokun committed 2025-09-05 18:20:49 -07:00
1 parent c02e94e767
commit 6e21bc5764
5 files changed
+15 -15

No files matched your search

+1 -2
View File
@@ -21,7 +21,6 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btclog/v2"
"github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/fn/v2"
@@ -2850,7 +2849,7 @@ func (lc *LightningChannel) fetchCommitmentView(
return nil, fmt.Errorf("height=%v, for ChannelPoint(%v) "+
"attempts to create commitment with feerate %v: %v",
nextHeight, lc.channelState.FundingOutpoint,
effFeeRate, spew.Sdump(commitTx))
effFeeRate, lnutils.SpewLogClosure(commitTx))
}
// Given the custom blob of the past state, and this new HTLC view,