blockchain: optimize HaveBlock
blockchain: optimize HaveBlock

Upstream commit 61a15f6f1bea14cb47aa4d70dd3d38dee5e7c701.

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