From 15c3f22ee0397983e1d1e09ac41335aed597fd04 Mon Sep 17 00:00:00 2001 From: Michael Boeckli Date: Tue, 19 Mar 2024 14:58:22 +0100 Subject: [PATCH] Increase channel size --- Peer.go | 3 ++- peer_integration_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Peer.go b/Peer.go index 35437c3..448b7ea 100644 --- a/Peer.go +++ b/Peer.go @@ -280,8 +280,9 @@ func (p *Peer) readRetry(r io.Reader, pver uint32, bsvnet wire.BitcoinNet) (wire } func (p *Peer) startReadHandler() { - p.quitReadHandler = make(chan struct{}) + p.quitReadHandler = make(chan struct{}, 10) + p.logger.Info("starting read handler") go func() { readConn := p.readConn diff --git a/peer_integration_test.go b/peer_integration_test.go index a681740..8be841a 100644 --- a/peer_integration_test.go +++ b/peer_integration_test.go @@ -92,7 +92,7 @@ func TestNewPeer(t *testing.T) { peer, err := NewPeer(logger, "localhost:18333", peerHandler, wire.TestNet) require.NoError(t, err) - + defer peer.Shutdown() time.Sleep(5 * time.Second) require.True(t, peer.Connected())