From 958ea38fdd8aca1b7ad9b8fe36bb7edc1259171f Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Fri, 28 Mar 2014 14:32:12 -0500 Subject: [PATCH] Export CheckProofOfWork function. --- validate.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/validate.go b/validate.go index 27b85b4e..a30a8ca7 100644 --- a/validate.go +++ b/validate.go @@ -259,10 +259,10 @@ func CheckTransactionSanity(tx *btcutil.Tx) error { return nil } -// checkProofOfWork ensures the block header bits which indicate the target +// CheckProofOfWork ensures the block header bits which indicate the target // difficulty is in min/max range and that the block hash is less than the // target difficulty as claimed. -func checkProofOfWork(block *btcutil.Block, powLimit *big.Int) error { +func CheckProofOfWork(block *btcutil.Block, powLimit *big.Int) error { // The target difficulty must be larger than zero. target := CompactToBig(block.MsgBlock().Header.Bits) if target.Sign() <= 0 { @@ -394,7 +394,7 @@ func CheckBlockSanity(block *btcutil.Block, powLimit *big.Int) error { // Ensure the proof of work bits in the block header is in min/max range // and the block hash is less than the target value described by the // bits. - err := checkProofOfWork(block, powLimit) + err := CheckProofOfWork(block, powLimit) if err != nil { return err }