Keep a timestamp index that will map a timestamp to a blockhash in a way that will keep the block order, and iterating by timestamp would not yield out-of-order blocks.
The timestamp could be defined as the actual block's timestamp or would assume the previous block's timestamp (with an additional second) if the block's timestamp is not greater than the previous timestamp.
Keep a timestamp index that will map a timestamp to a blockhash in a way that will keep the block order, and iterating by timestamp would not yield out-of-order blocks.
The timestamp could be defined as the actual block's timestamp or would assume the previous block's timestamp (with an additional second) if the block's timestamp is not greater than the previous timestamp.