Not a big problem but it can be misleading. The sort function should return a value less than 0 when a goes before b, 0 when equal, and greater than 0 when a goes after b.
A correction could be something like this:
blocks.sort(function(a,b) { return (b.h - a.h); });