mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-23 17:47:24 +00:00
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:
parent
761381066d
commit
b40a6f86ef
1 changed files with 2 additions and 2 deletions
|
@ -55,12 +55,12 @@ func (b *BlockChain) BlockLocatorFromHash(hash *wire.ShaHash) BlockLocator {
|
||||||
// Try to look up the height for passed block hash. Assume an
|
// Try to look up the height for passed block hash. Assume an
|
||||||
// error means it doesn't exist and just return the locator for
|
// error means it doesn't exist and just return the locator for
|
||||||
// the block itself.
|
// the block itself.
|
||||||
block, err := b.db.FetchBlockBySha(hash)
|
height, err := b.db.FetchBlockHeightBySha(hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return locator
|
return locator
|
||||||
}
|
}
|
||||||
blockHeight = block.Height()
|
|
||||||
|
|
||||||
|
blockHeight = height
|
||||||
} else {
|
} else {
|
||||||
blockHeight = node.height
|
blockHeight = node.height
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue