reparse speedup, messages desync fix

Taken from https://github.com/ClearingHouse/clearblockd/pull/9

@reorder can you please check the cherry-pick was done correctly.