blockchain: Optimize block locator generation.
blockchain: Optimize block locator generation.

This significantly optimizes and simplifies the generation of block
locators by making use of the fact that all block nodes are now in
memory and therefore it is no longer necessary to consult the database
for the hashes or worry about issues related to dynamic loading of nodes.

Also, it slightly modifies the algorithm so that the doubling doesn't
start for one additional iteration in order to mirror other prominent
clients on the network.  Due to the way block locators are used, this
does not change any semantics in terms of requesting and locating
blocks.

Finally, the semantics of BlockLocatorFromHash have been changed to
return a locator for the current tip in the case the hash is unknown.
This is far preferable since only including the passed block hash, when
it isn't known, could end up leading to causing a redownload of the
entire chain under certain circumstances.

tb00/btcd,davecgh/btcd,Stash-Crypto/btcd,wallclockbuilder/btcd,Roasbeef/btcd,aakselrod/btcd,dajohi/btcd,ltcsuite/ltcd,aakselrod/btcd,ppcsuite/ppcd,btcsuite/btcd,wallclockbuilder/btcd,ppcsuite/ppcd,Stash-Crypto/btcd,dajohi/btcd,ltcsuite/ltcd,davecgh/btcd,Roasbeef/btcd,dajohi/btcd,btcsuite/btcd,tb00/btcd