multi: add SpewLogClosure to avoid code repetition
This commit is contained in:
19 files changed
+57
-144
No files matched your search
@@ -5,7 +5,6 @@ import (
|
||||
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
"github.com/btcsuite/btclog"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/lightningnetwork/lnd/build"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/channeldb/models"
|
||||
@@ -433,7 +432,7 @@ func (p *paymentSession) UpdateAdditionalEdge(msg *lnwire.ChannelUpdate,
|
||||
policy.FeeProportionalMillionths = lnwire.MilliSatoshi(msg.FeeRate)
|
||||
|
||||
log.Debugf("New private channel update applied: %v",
|
||||
lnutils.NewLogClosure(func() string { return spew.Sdump(msg) }))
|
||||
lnutils.SpewLogClosure(msg))
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
+3
-9
@@ -670,10 +670,7 @@ func (r *ChannelRouter) FindRoute(req *RouteRequest) (*route.Route, float64,
|
||||
}
|
||||
|
||||
go log.Tracef("Obtained path to send %v to %x: %v",
|
||||
req.Amount, req.Target, lnutils.NewLogClosure(func() string {
|
||||
return spew.Sdump(route)
|
||||
}),
|
||||
)
|
||||
req.Amount, req.Target, lnutils.SpewLogClosure(route))
|
||||
|
||||
return route, probability, nil
|
||||
}
|
||||
@@ -1091,11 +1088,8 @@ func (r *ChannelRouter) sendToRoute(htlcHash lntypes.Hash, rt *route.Route,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Tracef("Dispatching SendToRoute for HTLC hash %v: %v",
|
||||
htlcHash, lnutils.NewLogClosure(func() string {
|
||||
return spew.Sdump(rt)
|
||||
}),
|
||||
)
|
||||
log.Tracef("Dispatching SendToRoute for HTLC hash %v: %v", htlcHash,
|
||||
lnutils.SpewLogClosure(rt))
|
||||
|
||||
// Since the HTLC hashes and preimages are specified manually over the
|
||||
// RPC for SendToRoute requests, we don't have to worry about creating
|
||||
|
||||
Reference in new issue
Block a user