@@ -14,7 +14,6 @@ import (
1414 "github.com/btcsuite/btcd/chaincfg/chainhash"
1515 "github.com/btcsuite/btcd/txscript"
1616 "github.com/btcsuite/btcd/wire"
17- "github.com/davecgh/go-spew/spew"
1817 "github.com/lightningnetwork/lnd/channeldb"
1918 "github.com/lightningnetwork/lnd/channeldb/models"
2019 "github.com/lightningnetwork/lnd/fn"
@@ -24,6 +23,7 @@ import (
2423 "github.com/lightningnetwork/lnd/kvdb"
2524 "github.com/lightningnetwork/lnd/labels"
2625 "github.com/lightningnetwork/lnd/lntypes"
26+ "github.com/lightningnetwork/lnd/lnutils"
2727 "github.com/lightningnetwork/lnd/lnwallet"
2828 "github.com/lightningnetwork/lnd/lnwire"
2929 "github.com/lightningnetwork/lnd/sweep"
@@ -465,10 +465,8 @@ func (c *ChannelArbitrator) Start(state *chanArbStartState) error {
465465 }
466466
467467 log .Debugf ("Starting ChannelArbitrator(%v), htlc_set=%v, state=%v" ,
468- c .cfg .ChanPoint , newLogClosure (func () string {
469- return spew .Sdump (c .activeHTLCs )
470- }), state .currentState ,
471- )
468+ c .cfg .ChanPoint , lnutils .SpewLogClosure (c .activeHTLCs ),
469+ state .currentState )
472470
473471 // Set our state from our starting state.
474472 c .state = state .currentState
@@ -958,10 +956,7 @@ func (c *ChannelArbitrator) stateStep(
958956 // Otherwise, we'll log that we checked the HTLC actions as the
959957 // commitment transaction has already been broadcast.
960958 log .Tracef ("ChannelArbitrator(%v): logging chain_actions=%v" ,
961- c .cfg .ChanPoint ,
962- newLogClosure (func () string {
963- return spew .Sdump (chainActions )
964- }))
959+ c .cfg .ChanPoint , lnutils .SpewLogClosure (chainActions ))
965960
966961 // Depending on the type of trigger, we'll either "tunnel"
967962 // through to a farther state, or just proceed linearly to the
@@ -1096,10 +1091,7 @@ func (c *ChannelArbitrator) stateStep(
10961091 // channel resolution state.
10971092 log .Infof ("Broadcasting force close transaction %v, " +
10981093 "ChannelPoint(%v): %v" , closeTx .TxHash (),
1099- c .cfg .ChanPoint ,
1100- newLogClosure (func () string {
1101- return spew .Sdump (closeTx )
1102- }))
1094+ c .cfg .ChanPoint , lnutils .SpewLogClosure (closeTx ))
11031095
11041096 // At this point, we'll now broadcast the commitment
11051097 // transaction itself.
@@ -1224,9 +1216,7 @@ func (c *ChannelArbitrator) stateStep(
12241216 if len (pktsToSend ) != 0 {
12251217 log .Debugf ("ChannelArbitrator(%v): sending " +
12261218 "resolution message=%v" , c .cfg .ChanPoint ,
1227- newLogClosure (func () string {
1228- return spew .Sdump (pktsToSend )
1229- }))
1219+ lnutils .SpewLogClosure (pktsToSend ))
12301220
12311221 err := c .cfg .DeliverResolutionMsg (pktsToSend ... )
12321222 if err != nil {
@@ -2741,11 +2731,7 @@ func (c *ChannelArbitrator) notifyContractUpdate(upd *ContractUpdate) {
27412731 c .unmergedSet [upd .HtlcKey ] = newHtlcSet (upd .Htlcs )
27422732
27432733 log .Tracef ("ChannelArbitrator(%v): fresh set of htlcs=%v" ,
2744- c .cfg .ChanPoint ,
2745- newLogClosure (func () string {
2746- return spew .Sdump (upd )
2747- }),
2748- )
2734+ c .cfg .ChanPoint , lnutils .SpewLogClosure (upd ))
27492735}
27502736
27512737// updateActiveHTLCs merges the unmerged set of HTLCs from the link with
0 commit comments