network: refactor blockqueuer interface

Remove unused argument.
This commit is contained in:
Anna Shaleva 2023-03-06 18:28:47 +03:00
parent e57e74692f
commit 91a77c25a2
3 changed files with 4 additions and 4 deletions

View file

@ -37,7 +37,7 @@ func indexToPosition(i uint32) int {
return int(i) % blockCacheSize return int(i) % blockCacheSize
} }
func newBlockQueue(capacity int, bc Blockqueuer, log *zap.Logger, relayer func(*block.Block)) *blockQueue { func newBlockQueue(bc Blockqueuer, log *zap.Logger, relayer func(*block.Block)) *blockQueue {
if log == nil { if log == nil {
return nil return nil
} }

View file

@ -13,7 +13,7 @@ import (
func TestBlockQueue(t *testing.T) { func TestBlockQueue(t *testing.T) {
chain := fakechain.NewFakeChain() chain := fakechain.NewFakeChain()
// notice, it's not yet running // notice, it's not yet running
bq := newBlockQueue(0, chain, zaptest.NewLogger(t), nil) bq := newBlockQueue(chain, zaptest.NewLogger(t), nil)
blocks := make([]*block.Block, 11) blocks := make([]*block.Block, 11)
for i := 1; i < 11; i++ { for i := 1; i < 11; i++ {
blocks[i] = &block.Block{Header: block.Header{Index: uint32(i)}} blocks[i] = &block.Block{Header: block.Header{Index: uint32(i)}}

View file

@ -204,11 +204,11 @@ func newServerFromConstructors(config ServerConfig, chain Ledger, stSync StateSy
}, s.notaryFeer) }, s.notaryFeer)
}) })
} }
s.bQueue = newBlockQueue(maxBlockBatch, chain, log, func(b *block.Block) { s.bQueue = newBlockQueue(chain, log, func(b *block.Block) {
s.tryStartServices() s.tryStartServices()
}) })
s.bSyncQueue = newBlockQueue(maxBlockBatch, s.stateSync, log, nil) s.bSyncQueue = newBlockQueue(s.stateSync, log, nil)
if s.MinPeers < 0 { if s.MinPeers < 0 {
s.log.Info("bad MinPeers configured, using the default value", s.log.Info("bad MinPeers configured, using the default value",