From 74386998be14102d2b158f2d93dfeaee67857130 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Mon, 11 Aug 2014 01:52:34 -0500 Subject: [PATCH] Correct the addblock utility import. This commit corrects the check in the addblock utility to check each block links the previous hash as intended versus the current block. Fixes #162. --- util/addblock/import.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/addblock/import.go b/util/addblock/import.go index 1ca99299..91906ca6 100644 --- a/util/addblock/import.go +++ b/util/addblock/import.go @@ -119,14 +119,14 @@ func (bi *blockImporter) processBlock(serializedBlock []byte) (bool, error) { // Don't bother trying to process orphans. prevHash := &block.MsgBlock().Header.PrevBlock if !prevHash.IsEqual(&zeroHash) { - exists, err := bi.db.ExistsSha(blockSha) + exists, err := bi.db.ExistsSha(prevHash) if err != nil { return false, err } if !exists { return false, fmt.Errorf("import file contains block "+ "%v which does not link to the available "+ - "block chain", blockSha) + "block chain", prevHash) } }