optimize remote and local getblocks, execute only one remote query at a time
fix getblocks DOS issue