diff --git a/network/ipfs_impl.go b/network/ipfs_impl.go index efeb693c29f4b100c2f0694fe16c3139aa847628..1b6e38986f5ed99f45ee95e925a91e2d5cb04462 100644 --- a/network/ipfs_impl.go +++ b/network/ipfs_impl.go @@ -123,9 +123,10 @@ func (bsnet *impl) SendMessage( s.Reset() return err } - // Yes, return this error. We have no reason to believe that the block - // was actually *sent* unless we see the EOF. - return inet.FullClose(s) + // TODO(https://github.com/libp2p/go-libp2p-net/issues/28): Avoid this goroutine. + go inet.AwaitEOF(s) + return s.Close() + } func (bsnet *impl) SetDelegate(r Receiver) {