Well, bitcoind only notifies my app in case the accepted block is part of the current best chain:
if (hashBestChain == hash)
{
monitorBlock(*this, pindexBest);
}
So I will not get notification of blocks that are not on the main chain. But looking at the code indeed it seems I might miss new blocks during reorg.
Some more background info:
Normally i take a new block notification just as a trigger to check the monitored transactions if they got more confirmations now. I only look at the contained transactions of a new block to catch cases where the initial, unconfirmed transaction was not received. This might happen if bitcoind or the main app was offline for any reason or the user set up an address to monitor only after the transaction came in.
So this leads back to the original question: To catch up in these offline cases, can i just take the current height, calculate delta with the last seen block's height and get height-delta to height-1 blocks from bitcoind to catch up? Or could there be cases when the blockheight is "jumpy", e.g. not linear?