mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-08 14:57:38 +02:00
multi: add NewLogClosure
in lnutils
to avoid repetition
And replaces all usage of `logClosure` with `lnutils.LogClosure`.
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/htlcswitch/hop"
|
||||
"github.com/lightningnetwork/lnd/kvdb"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/lightningnetwork/lnd/lnutils"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
@@ -613,9 +614,10 @@ func (s *Switch) SendHTLC(firstHop lnwire.ShortChannelID, attemptID uint64,
|
||||
func (s *Switch) UpdateForwardingPolicies(
|
||||
chanPolicies map[wire.OutPoint]models.ForwardingPolicy) {
|
||||
|
||||
log.Tracef("Updating link policies: %v", newLogClosure(func() string {
|
||||
return spew.Sdump(chanPolicies)
|
||||
}))
|
||||
log.Tracef("Updating link policies: %v", lnutils.NewLogClosure(
|
||||
func() string {
|
||||
return spew.Sdump(chanPolicies)
|
||||
}))
|
||||
|
||||
s.indexMtx.RLock()
|
||||
|
||||
@@ -1213,7 +1215,8 @@ func (s *Switch) handlePacketForward(packet *htlcPacket) error {
|
||||
)
|
||||
log.Warnf("unable to find err source for "+
|
||||
"outgoing_link=%v, errors=%v",
|
||||
packet.outgoingChanID, newLogClosure(func() string {
|
||||
packet.outgoingChanID,
|
||||
lnutils.NewLogClosure(func() string {
|
||||
return spew.Sdump(linkErrs)
|
||||
}))
|
||||
}
|
||||
@@ -1994,8 +1997,9 @@ out:
|
||||
continue
|
||||
}
|
||||
|
||||
log.Tracef("Acked %d settle fails: %v", len(s.pendingSettleFails),
|
||||
newLogClosure(func() string {
|
||||
log.Tracef("Acked %d settle fails: %v",
|
||||
len(s.pendingSettleFails),
|
||||
lnutils.NewLogClosure(func() string {
|
||||
return spew.Sdump(s.pendingSettleFails)
|
||||
}))
|
||||
|
||||
|
Reference in New Issue
Block a user