Melt the butter in a medium sauce-pan. Add the carrot, celery and onion and cook over moderately low heat, stirring, until softened, about 10 minutes. Add the chestnuts and cook for 4 minutes. Add the port and thyme and cook over moderately high heat until the port is reduced by half, about 4 minutes. Add the stock and bring to a boil. Cover partially and simmer over low heat for 30 minutes. Discard the thyme sprig.