mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-04 07:01:40 +00:00
return back defaultChannelCapacity
This commit is contained in:
@ -34,8 +34,8 @@ func makePeers(numPeers int, minHeight, maxHeight int64) map[p2p.ID]testPeer {
|
|||||||
func TestBasic(t *testing.T) {
|
func TestBasic(t *testing.T) {
|
||||||
start := int64(42)
|
start := int64(42)
|
||||||
peers := makePeers(10, start+1, 1000)
|
peers := makePeers(10, start+1, 1000)
|
||||||
errorsCh := make(chan peerError)
|
errorsCh := make(chan peerError, 1000)
|
||||||
requestsCh := make(chan BlockRequest)
|
requestsCh := make(chan BlockRequest, 1000)
|
||||||
pool := NewBlockPool(start, requestsCh, errorsCh)
|
pool := NewBlockPool(start, requestsCh, errorsCh)
|
||||||
pool.SetLogger(log.TestingLogger())
|
pool.SetLogger(log.TestingLogger())
|
||||||
|
|
||||||
@ -91,8 +91,8 @@ func TestBasic(t *testing.T) {
|
|||||||
func TestTimeout(t *testing.T) {
|
func TestTimeout(t *testing.T) {
|
||||||
start := int64(42)
|
start := int64(42)
|
||||||
peers := makePeers(10, start+1, 1000)
|
peers := makePeers(10, start+1, 1000)
|
||||||
errorsCh := make(chan peerError)
|
errorsCh := make(chan peerError, 1000)
|
||||||
requestsCh := make(chan BlockRequest)
|
requestsCh := make(chan BlockRequest, 1000)
|
||||||
pool := NewBlockPool(start, requestsCh, errorsCh)
|
pool := NewBlockPool(start, requestsCh, errorsCh)
|
||||||
pool.SetLogger(log.TestingLogger())
|
pool.SetLogger(log.TestingLogger())
|
||||||
err := pool.Start()
|
err := pool.Start()
|
||||||
|
@ -76,8 +76,9 @@ func NewBlockchainReactor(state sm.State, blockExec *sm.BlockExecutor, store *Bl
|
|||||||
store.Height()))
|
store.Height()))
|
||||||
}
|
}
|
||||||
|
|
||||||
requestsCh := make(chan BlockRequest)
|
const cap = 1000 // must be bigger than peers count
|
||||||
errorsCh := make(chan peerError)
|
requestsCh := make(chan BlockRequest, cap)
|
||||||
|
errorsCh := make(chan peerError, cap) // so we don't block in #Receive#pool.AddBlock
|
||||||
pool := NewBlockPool(
|
pool := NewBlockPool(
|
||||||
store.Height()+1,
|
store.Height()+1,
|
||||||
requestsCh,
|
requestsCh,
|
||||||
|
Reference in New Issue
Block a user