server: Optimize get mining state code.
server: Optimize get mining state code.

This slightly optimizes the code which is invoked to provide the current
mining state to remote peers.

First, rather than creating copies of all of the hashes into a new slice
while limiting them in the OnGetMiningState function, just subslice
the hashes to the max length when there are too many.

Second, make the slices []chainhash.Hash which has better cache
locality and only requires a single allocation as opposed to one per
hash.

Finally, convert the pushMiningState function to accept []chainhash.Hash
slices for the block hashes and vote hashes and use the hashes directly
in the slices to build the final wire message.

jrick/dcrd,decred/dcrd,jrick/btcd,jcmincke/dcrd,jrick/btcd,jcmincke/dcrd,jcmincke/dcrd,decred/dcrd,jrick/dcrd,jrick/btcd