From e5ba199eed1818aa82da07067cf17396f0381789 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sun, 13 Oct 2013 02:06:18 -0500 Subject: [PATCH] Add example to BlockLocator comments. --- blocklocator.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/blocklocator.go b/blocklocator.go index fb2d408be..0e783b4ea 100644 --- a/blocklocator.go +++ b/blocklocator.go @@ -15,6 +15,14 @@ import ( // hashes are added, then the step is doubled each loop iteration to // exponentially decrease the number of hashes as a function of the distance // 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 // BlockLocatorFromHash returns a block locator for the passed block hash.