code: func newBlockStore(basePath string, network wire.BitcoinNet) *blockStore {
  	// Look for the end of the latest block to file to determine what the
  	// write cursor position is from the viewpoing of the block files on
  	// disk.
  	fileNum, fileOff := scanBlockFiles(basePath)
  	if fileNum == -1 {
  		fileNum = 0
  		fileOff = 0
  	}
  
  	store := &blockStore{
  		network:          network,
  		basePath:         basePath,
  		maxBlockFileSize: maxBlockFileSize,
  		openBlockFiles:   make(map[uint32]*lockableFile),
  		openBlocksLRU:    list.New(),
  		fileNumToLRUElem: make(map[uint32]*list.Element),
  
  		writeCursor: &writeCursor{
  			curFile:    &lockableFile{},
  			curFileNum: uint32(fileNum),
  			curOffset:  fileOff,
  		},
  	}
  	store.openFileFunc = store.openFile
  	store.openWriteFileFunc = store.openWriteFile
  	store.deleteFileFunc = store.deleteFile
  	return store
  }
docs: // newBlockStore returns a new block store with the current block file number
  // and offset set and all fields initialized.