hltcswitch: use a logClosure to delay spew evaluation until log print time

This commit is contained in:
Olaoluwa Osuntokun 2018-06-30 17:14:59 -05:00
parent 39c1f46f85
commit 3ad15c5f42
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -1566,8 +1566,13 @@ func (l *channelLink) updateCommitTx() error {
if err == lnwallet.ErrNoWindow { if err == lnwallet.ErrNoWindow {
l.tracef("revocation window exhausted, unable to send: %v, "+ l.tracef("revocation window exhausted, unable to send: %v, "+
"dangling_opens=%v, dangling_closes%v", "dangling_opens=%v, dangling_closes%v",
l.batchCounter, spew.Sdump(l.openedCircuits), l.batchCounter, newLogClosure(func() string {
spew.Sdump(l.closedCircuits)) return spew.Sdump(l.openedCircuits)
}),
newLogClosure(func() string {
return spew.Sdump(l.closedCircuits)
}),
)
return nil return nil
} else if err != nil { } else if err != nil {
return err return err