Add example to BlockLocator comments.
This commit is contained in:
parent
b680d3539f
commit
e5ba199eed
1 changed files with 8 additions and 0 deletions
|
@ -15,6 +15,14 @@ import (
|
||||||
// hashes are added, then the step is doubled each loop iteration to
|
// hashes are added, then the step is doubled each loop iteration to
|
||||||
// exponentially decrease the number of hashes as a function of the distance
|
// exponentially decrease the number of hashes as a function of the distance
|
||||||
// from the block being located.
|
// from the block being located.
|
||||||
|
//
|
||||||
|
// For example, assume you have a block chain with a side chain as depicted
|
||||||
|
// below:
|
||||||
|
// genesis -> 1 -> 2 -> ... -> 15 -> 16 -> 17 -> 18
|
||||||
|
// \-> 16a -> 17a
|
||||||
|
//
|
||||||
|
// The block locator for block 17a would be the hashes of blocks:
|
||||||
|
// [17a 16a 15 14 13 12 11 10 9 8 6 2 genesis]
|
||||||
type BlockLocator []*btcwire.ShaHash
|
type BlockLocator []*btcwire.ShaHash
|
||||||
|
|
||||||
// BlockLocatorFromHash returns a block locator for the passed block hash.
|
// BlockLocatorFromHash returns a block locator for the passed block hash.
|
||||||
|
|
Loading…
Reference in a new issue