Add locks before writing to pblocktree.