I just wanted to make sure that this part of the code
AND cc.in_longest = 1
in this SQL query
SELECT b.block_hash, b.block_height, b.block_nTime, b.block_num_tx,
b.block_nBits, b.block_value_out,
b.block_total_seconds, b.block_satoshi_seconds,
b.block_total_satoshis, b.block_ss_destroyed,
b.block_total_ss
FROM block b
JOIN chain_candidate cc ON (b.block_id = cc.block_id)
WHERE cc.chain_id = 1
AND cc.block_height BETWEEN 100 AND 200
AND cc.in_longest = 1
ORDER BY cc.block_height DESC LIMIT 50
makes sure that the query returns only valid blocks. leaving orphans out.
inversely, if I would be writing
AND cc.in_longest = 0
I would have be getting only orphans? is that correct?