NewBlockSyncMgr return a BlockSyncMgr instance
(server *P2PServer)
| 240 | |
| 241 | //NewBlockSyncMgr return a BlockSyncMgr instance |
| 242 | func 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 | |
| 254 | type BlockCache struct { |
| 255 | emptyBlockAmount int |
no test coverage detected