(A). A glass of grog before going to bed. Supposed to promote sleep.
“The nightcap is generally a little whisky left in the decanter. To
do it honour it is taken neat. Then all get up and wish
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894
More on Nightcap from Infoplease: