bool isRPOSorted(const BlockList& blocks) { int id = 0; for (auto it = blocks.rbegin(); it != blocks.rend(); ++it) { if ((*it)->postId() != id++) return false; } return true; }