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 {
l.tracef("revocation window exhausted, unable to send: %v, "+
"dangling_opens=%v, dangling_closes%v",
l.batchCounter, spew.Sdump(l.openedCircuits),
spew.Sdump(l.closedCircuits))
l.batchCounter, newLogClosure(func() string {
return spew.Sdump(l.openedCircuits)
}),
newLogClosure(func() string {
return spew.Sdump(l.closedCircuits)
}),
)
return nil
} else if err != nil {
return err