From 8a34b1ae8897189144e7fd1d8478273f2590ad17 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 16 May 2019 17:38:44 -0700 Subject: [PATCH] contractcourt: only send resolution messages if we have any to send --- contractcourt/channel_arbitrator.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/contractcourt/channel_arbitrator.go b/contractcourt/channel_arbitrator.go index 0861aab0..28040961 100644 --- a/contractcourt/channel_arbitrator.go +++ b/contractcourt/channel_arbitrator.go @@ -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 "+