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
@@ -10,7 +10,6 @@ import (
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/fn/v2"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch"
|
||||
@@ -414,7 +413,7 @@ func (c *ChanCloser) initChanShutdown() (*lnwire.Shutdown, error) {
|
||||
)
|
||||
|
||||
chancloserLog.Infof("Initiating shutdown w/ nonce: %v",
|
||||
spew.Sdump(firstClosingNonce.PubNonce))
|
||||
lnutils.SpewLogClosure(firstClosingNonce.PubNonce))
|
||||
}
|
||||
|
||||
// Before closing, we'll attempt to send a disable update for the
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/mempool"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/lightningnetwork/lnd/fn/v2"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/labels"
|
||||
@@ -799,7 +798,7 @@ func (l *LocalCloseStart) ProcessEvent(event ProtocolEvent,
|
||||
l.RemoteDeliveryScript[:], absoluteFee)
|
||||
|
||||
chancloserLog.Infof("proposing closing_tx=%v",
|
||||
spew.Sdump(closeTx))
|
||||
lnutils.SpewLogClosure(closeTx))
|
||||
|
||||
// Now that we have our signature, we'll set the proper
|
||||
// closingSigs field based on if the remote party's output is
|
||||
|
||||
Reference in new issue
Block a user