private BufferNode getBufferNode(int id, boolean load) throws IOException {

		BufferNode node = getCachedBufferNode(id);
		if (node == null) {

			// First time buffer has been requested - get from source file
			if (sourceFile == null) {
				throw new IOException("Invalid buffer");
			}
// ?? error handling
			DataBuffer buf = getCacheBuffer();
			try {
				sourceFile.get(buf, id); // use source buffer id as index
			}
			catch (IOException e) {
				returnFreeBuffer(buf);
				throw e;
			}

			// Create new buffer node at checkpoint 0 (baseline)
			node = createNewBufferNode(id, baselineCheckpointHead, null);

			// Add node to cache
			returnToCache(node, buf);

			return node;
		}
		else if (node.locked) {
			throw new IOException("Locked buffer: " + id);
		}

		// if requested, load from disk cache file and add node to memory cache list
		if (load) {
			loadCachedNode(node);
		}

		return node;
	}
Get the buffer node at the current checkpoint level.
Creates node from source if necessary.
@param id buffer id.
@param load if true, buffer will be loaded into memory cache.
@return buffer node or null if node not found
@throws IOException if source or cache file access error occurs
Ghidra/Framework/DB/src/main/java/db/buffers/BufferMgr.java