(nodeID uint64, block *types.Block, merkleRoot common.Uint256)
| 264 | } |
| 265 | |
| 266 | func (this *BlockCache) addBlock(nodeID uint64, block *types.Block, |
| 267 | merkleRoot common.Uint256) bool { |
| 268 | this.delBlockLocked(block.Header.Height) |
| 269 | blockInfo := &BlockInfo{ |
| 270 | nodeID: nodeID, |
| 271 | block: block, |
| 272 | merkleRoot: merkleRoot, |
| 273 | } |
| 274 | this.blocksCache[block.Header.Height] = blockInfo |
| 275 | if block.Header.TransactionsRoot == common.UINT256_EMPTY { |
| 276 | this.emptyBlockAmount += 1 |
| 277 | } |
| 278 | return true |
| 279 | } |
| 280 | |
| 281 | func (this *BlockSyncMgr) clearBlocks(curBlockHeight uint32) { |
| 282 | this.lock.Lock() |
no test coverage detected