From 5dd1da9ebfeeaf8095c9610294c7bfd9f595783f Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 13 Jan 2021 10:37:18 -0500 Subject: [PATCH] blockchain v0: move to constant --- blockchain/v0/pool.go | 1 + blockchain/v0/reactor.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/blockchain/v0/pool.go b/blockchain/v0/pool.go index fa4d28954..bbb5bbf80 100644 --- a/blockchain/v0/pool.go +++ b/blockchain/v0/pool.go @@ -30,6 +30,7 @@ eg, L = latency = 0.1s const ( requestIntervalMS = 2 maxTotalRequesters = 600 + maxPeerErrBuffer = 1000 maxPendingRequests = maxTotalRequesters maxPendingRequestsPerPeer = 20 diff --git a/blockchain/v0/reactor.go b/blockchain/v0/reactor.go index 01fa2a09c..b2dc404a7 100644 --- a/blockchain/v0/reactor.go +++ b/blockchain/v0/reactor.go @@ -118,7 +118,7 @@ func NewReactor( } requestsCh := make(chan BlockRequest, maxTotalRequesters) - errorsCh := make(chan peerError, 1000) // NOTE: The capacity should be larger than the peer count. + errorsCh := make(chan peerError, maxPeerErrBuffer) // NOTE: The capacity should be larger than the peer count. r := &Reactor{ initialState: state,