mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
contractcourt: only send resolution messages if we have any to send
This commit is contained in:
@@ -895,12 +895,15 @@ func (c *ChannelArbitrator) stateStep(
|
|||||||
|
|
||||||
// With the commitment broadcast, we'll then send over all
|
// With the commitment broadcast, we'll then send over all
|
||||||
// messages we can send immediately.
|
// messages we can send immediately.
|
||||||
err = c.cfg.DeliverResolutionMsg(pktsToSend...)
|
if len(pktsToSend) != 0 {
|
||||||
|
err := c.cfg.DeliverResolutionMsg(pktsToSend...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO(roasbeef): make sure packet sends are idempotent
|
// TODO(roasbeef): make sure packet sends are
|
||||||
|
// idempotent
|
||||||
log.Errorf("unable to send pkts: %v", err)
|
log.Errorf("unable to send pkts: %v", err)
|
||||||
return StateError, closeTx, err
|
return StateError, closeTx, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.Debugf("ChannelArbitrator(%v): inserting %v contract "+
|
log.Debugf("ChannelArbitrator(%v): inserting %v contract "+
|
||||||
"resolvers", c.cfg.ChanPoint, len(htlcResolvers))
|
"resolvers", c.cfg.ChanPoint, len(htlcResolvers))
|
||||||
|
Reference in New Issue
Block a user