blockchain: Just fetch the height

We only care about the height, so just fetch the height instead of
the entire block.
This commit is contained in:
David Hill 2015-02-12 16:10:08 -05:00
parent 761381066d
commit b40a6f86ef

View file

@ -55,12 +55,12 @@ func (b *BlockChain) BlockLocatorFromHash(hash *wire.ShaHash) BlockLocator {
// Try to look up the height for passed block hash. Assume an
// error means it doesn't exist and just return the locator for
// the block itself.
block, err := b.db.FetchBlockBySha(hash)
height, err := b.db.FetchBlockHeightBySha(hash)
if err != nil {
return locator
}
blockHeight = block.Height()
blockHeight = height
} else {
blockHeight = node.height