View definition

(*BlockChain).BlockLocatorFromHash

Defined in github.com/btcsuite/btcd/blockchain/blocklocator.go

Description

BlockLocatorFromHash returns a block locator for the passed block hash. See BlockLocator for details on the algorithm used to create a block locator.

In addition to the general algorithm referenced above, there are a couple of special cases which are handled:

- If the genesis hash is passed, there are no previous hashes to add and
  therefore the block locator will only consist of the genesis hash
- If the passed hash is not currently known, the block locator will only
  consist of the passed hash

This function is safe for concurrent access.

BlockLocatorFromHash is referenced in 2 repositories

github.com/btcsuite/btcd

...