From a73e023320732e5c3924f65961fc0dd54e5d18c7 Mon Sep 17 00:00:00 2001 From: Yahtoo Ma Date: Wed, 29 Aug 2018 10:46:06 +0800 Subject: [PATCH] Revert block header validation func --- protocol/validation/block.go | 45 -------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/protocol/validation/block.go b/protocol/validation/block.go index fb102439..2cbf479d 100644 --- a/protocol/validation/block.go +++ b/protocol/validation/block.go @@ -71,48 +71,3 @@ func ValidateBlockHeader(b *bc.Block, parent *state.BlockNode) error { } return nil } - -// ValidateBlock validates a block and the transactions within. -func ValidateBlock(b *bc.Block, parent *state.BlockNode) error { - if err := ValidateBlockHeader(b, parent); err != nil { - return err - } - - //blockGasSum := uint64(0) - //coinbaseAmount := consensus.BlockSubsidy(b.BlockHeader.Height) - b.TransactionStatus = bc.NewTransactionStatus() - - //for i, tx := range b.Transactions { - //gasStatus, err := ValidateTx(tx, b) - //if !gasStatus.GasValid { - // return errors.Wrapf(err, "validate of transaction %d of %d", i, len(b.Transactions)) - //} - - //b.TransactionStatus.SetStatus(i, err != nil) - //coinbaseAmount += gasStatus.BTMValue - //if blockGasSum += uint64(gasStatus.GasUsed); blockGasSum > consensus.MaxBlockGas { - // return errOverBlockLimit - //} - //} - - //if err := checkCoinbaseAmount(b, coinbaseAmount); err != nil { - // return err - //} - // - //txMerkleRoot, err := bc.TxMerkleRoot(b.Transactions) - //if err != nil { - // return errors.Wrap(err, "computing transaction id merkle root") - //} - //if txMerkleRoot != *b.TransactionsRoot { - // return errors.WithDetailf(errMismatchedMerkleRoot, "transaction id merkle root") - //} - - //txStatusHash, err := bc.TxStatusMerkleRoot(b.TransactionStatus.VerifyStatus) - //if err != nil { - // return errors.Wrap(err, "computing transaction status merkle root") - //} - //if txStatusHash != *b.TransactionStatusHash { - // return errors.WithDetailf(errMismatchedMerkleRoot, "transaction status merkle root") - //} - return nil -} -- 2.11.0