contractcourt: only send resolution messages if we have any to send

This commit is contained in:
Olaoluwa Osuntokun committed 2019-05-27 15:26:39 -07:00
1 parent 877b8c55d3
commit 8a34b1ae88
1 file changed
+8 -5
+8 -5
View File
@@ -895,11 +895,14 @@ func (c *ChannelArbitrator) stateStep(
// With the commitment broadcast, we'll then send over all
// messages we can send immediately.
err = c.cfg.DeliverResolutionMsg(pktsToSend...)
if err != nil {
// TODO(roasbeef): make sure packet sends are idempotent
log.Errorf("unable to send pkts: %v", err)
return StateError, closeTx, err
if len(pktsToSend) != 0 {
err := c.cfg.DeliverResolutionMsg(pktsToSend...)
if err != nil {
// TODO(roasbeef): make sure packet sends are
// idempotent
log.Errorf("unable to send pkts: %v", err)
return StateError, closeTx, err
}
}
log.Debugf("ChannelArbitrator(%v): inserting %v contract "+