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:
5 files changed
+15
-15
No files matched your search
+1
-2
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user