MCPcopy Create free account
hub / github.com/DNAProject/DNA / NewBlockSyncMgr

Function NewBlockSyncMgr

p2pserver/block_sync.go:242–252  ·  view source on GitHub ↗

NewBlockSyncMgr return a BlockSyncMgr instance

(server *P2PServer)

Source from the content-addressed store, hash-verified

240
241//NewBlockSyncMgr return a BlockSyncMgr instance
242func NewBlockSyncMgr(server *P2PServer) *BlockSyncMgr {
243 return &BlockSyncMgr{
244 flightBlocks: make(map[common.Uint256][]*SyncFlightInfo, 0),
245 flightHeaders: make(map[uint32]*SyncFlightInfo, 0),
246 blocksCache: NewBlockCache(),
247 server: server,
248 ledger: server.ledger,
249 exitCh: make(chan interface{}, 1),
250 nodeWeights: make(map[uint64]*NodeWeight, 0),
251 }
252}
253
254type BlockCache struct {
255 emptyBlockAmount int

Callers 1

NewServerFunction · 0.85

Calls 1

NewBlockCacheFunction · 0.70

Tested by

no test coverage detected