From cd583a4b84d537931793b5ffa4da6617cf2931d7 Mon Sep 17 00:00:00 2001 From: eugene Date: Mon, 28 Nov 2022 12:57:33 -0500 Subject: [PATCH] blockchain: export CheckBlockHeaderSanity as a library function --- blockchain/validate.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blockchain/validate.go b/blockchain/validate.go index 662eb41b725..36158bd896d 100644 --- a/blockchain/validate.go +++ b/blockchain/validate.go @@ -421,13 +421,13 @@ func CountP2SHSigOps(tx *btcutil.Tx, isCoinBaseTx bool, utxoView *UtxoViewpoint) return totalSigOps, nil } -// checkBlockHeaderSanity performs some preliminary checks on a block header to +// CheckBlockHeaderSanity performs some preliminary checks on a block header to // ensure it is sane before continuing with processing. These checks are // context free. // // The flags do not modify the behavior of this function directly, however they // are needed to pass along to checkProofOfWork. -func checkBlockHeaderSanity(header *wire.BlockHeader, powLimit *big.Int, timeSource MedianTimeSource, flags BehaviorFlags) error { +func CheckBlockHeaderSanity(header *wire.BlockHeader, powLimit *big.Int, timeSource MedianTimeSource, flags BehaviorFlags) 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. @@ -467,7 +467,7 @@ func checkBlockHeaderSanity(header *wire.BlockHeader, powLimit *big.Int, timeSou func checkBlockSanity(block *btcutil.Block, powLimit *big.Int, timeSource MedianTimeSource, flags BehaviorFlags) error { msgBlock := block.MsgBlock() header := &msgBlock.Header - err := checkBlockHeaderSanity(header, powLimit, timeSource, flags) + err := CheckBlockHeaderSanity(header, powLimit, timeSource, flags) if err != nil { return err }