diff --git a/ipam/allocate.go b/ipam/allocate.go index c1dcda66..f2da3c74 100644 --- a/ipam/allocate.go +++ b/ipam/allocate.go @@ -44,8 +44,10 @@ func (g *allocate) Try(alloc *Allocator) bool { // out of space donors := alloc.ring.ChoosePeersToAskForSpace(g.r.Start, g.r.End) for _, donor := range donors { - alloc.debugln("Decided to ask peer", donor, "for space in range", g.r) - if err := alloc.sendSpaceRequest(donor, g.r); err == nil { + if err := alloc.sendSpaceRequest(donor, g.r); err != nil { + alloc.debugln("Problem asking peer", donor, "for space:", err) + } else { + alloc.debugln("Decided to ask peer", donor, "for space in range", g.r) break } } diff --git a/router/gossip_channel.go b/router/gossip_channel.go index bbc177db..39de093a 100644 --- a/router/gossip_channel.go +++ b/router/gossip_channel.go @@ -59,9 +59,11 @@ func (c *GossipChannel) deliverUnicast(srcName PeerName, origPayload []byte, dec return err } if c.ourself.Name != destName { - c.relayUnicast(destName, origPayload) - // ignore errors in passing on data; a problem between us and destination - // is not enough reason to break the connection from the source + if err := c.relayUnicast(destName, origPayload); err != nil { + // just log errors from relayUnicast; a problem between us and destination + // is not enough reason to break the connection from the source + c.log(err) + } return nil } var payload []byte @@ -172,9 +174,6 @@ func (c *GossipChannel) relayUnicast(dstPeerName PeerName, buf []byte) (err erro } else { conn.(ProtocolSender).SendProtocolMsg(ProtocolMsg{ProtocolGossipUnicast, buf}) } - if err != nil { - c.log(err) - } return err }