contractcourt+sweep+watchtower: use lnutils.SpewLogClosure for debug logging
In this commit, we update the contractcourt, sweep, and watchtower packages to use lnutils.SpewLogClosure instead of directly calling spew.Sdump in logging statements.
This commit is contained in:
5 files changed
+10
-13
No files matched your search
@@ -588,10 +588,10 @@ func newChainSet(chanState *channeldb.OpenChannel) (*chainSet, error) {
|
||||
|
||||
log.Tracef("ChannelPoint(%v): local_commit_type=%v, local_commit=%v",
|
||||
chanState.FundingOutpoint, chanState.ChanType,
|
||||
spew.Sdump(localCommit))
|
||||
lnutils.SpewLogClosure(localCommit))
|
||||
log.Tracef("ChannelPoint(%v): remote_commit_type=%v, remote_commit=%v",
|
||||
chanState.FundingOutpoint, chanState.ChanType,
|
||||
spew.Sdump(remoteCommit))
|
||||
lnutils.SpewLogClosure(remoteCommit))
|
||||
|
||||
// Fetch the current known commit height for the remote party, and
|
||||
// their pending commitment chain tip if it exists.
|
||||
@@ -619,7 +619,7 @@ func newChainSet(chanState *channeldb.OpenChannel) (*chainSet, error) {
|
||||
log.Tracef("ChannelPoint(%v): remote_pending_commit_type=%v, "+
|
||||
"remote_pending_commit=%v", chanState.FundingOutpoint,
|
||||
chanState.ChanType,
|
||||
spew.Sdump(remoteChainTip.Commitment))
|
||||
lnutils.SpewLogClosure(remoteChainTip.Commitment))
|
||||
|
||||
htlcs := remoteChainTip.Commitment.Htlcs
|
||||
commitSet.HtlcSets[RemotePendingHtlcSet] = htlcs
|
||||
@@ -995,7 +995,8 @@ func (c *chainWatcher) dispatchCooperativeClose(commitSpend *chainntnfs.SpendDet
|
||||
broadcastTx := commitSpend.SpendingTx
|
||||
|
||||
log.Infof("Cooperative closure for ChannelPoint(%v): %v",
|
||||
c.cfg.chanState.FundingOutpoint, spew.Sdump(broadcastTx))
|
||||
c.cfg.chanState.FundingOutpoint,
|
||||
lnutils.SpewLogClosure(broadcastTx))
|
||||
|
||||
// If the input *is* final, then we'll check to see which output is
|
||||
// ours.
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/fn/v2"
|
||||
@@ -167,7 +166,7 @@ func (h *htlcTimeoutResolver) claimCleanUp(
|
||||
|
||||
log.Infof("%T(%v): extracting preimage! remote party spent "+
|
||||
"HTLC with tx=%v", h, h.htlcResolution.ClaimOutpoint,
|
||||
spew.Sdump(commitSpend.SpendingTx))
|
||||
lnutils.SpewLogClosure(commitSpend.SpendingTx))
|
||||
|
||||
// If this is the remote party's commitment, then we'll be looking for
|
||||
// them to spend using the second-level success transaction.
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/fn/v2"
|
||||
@@ -964,7 +963,7 @@ func (u *UtxoNursery) sweepCribOutput(classHeight uint32, baby *babyOutput) erro
|
||||
!errors.Is(err, lnwallet.ErrMempoolFee) {
|
||||
|
||||
utxnLog.Errorf("Unable to broadcast baby tx: "+
|
||||
"%v, %v", err, spew.Sdump(baby.timeoutTx))
|
||||
"%v, %v", err, lnutils.SpewLogClosure(baby.timeoutTx))
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user