aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-05-27 19:34:34 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-05-27 19:34:34 +0800
commit69f7a1da5a92b81e2dc6a0a8493a8a456e093623 (patch)
tree008a129239121fd97f0ca96ea2378864497c9375
parent34729c365bf61de48162a3c6d72f475e9f43a4b0 (diff)
parentbf5f0b1d0cf9207c8958646f6ac16ffbaf89d7fa (diff)
downloadgo-tangerine-69f7a1da5a92b81e2dc6a0a8493a8a456e093623.tar.gz
go-tangerine-69f7a1da5a92b81e2dc6a0a8493a8a456e093623.tar.zst
go-tangerine-69f7a1da5a92b81e2dc6a0a8493a8a456e093623.zip
Merge pull request #1122 from Gustav-Simonsson/improve_validate_header_comments
Update ValidateHeader comments
-rw-r--r--core/block_processor.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index 037782407..e064cdd80 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -285,9 +285,8 @@ func (self *BlockProcessor) GetBlockReceipts(bhash common.Hash) (receipts types.
}
-// Validates the current block. Returns an error if the block was invalid,
-// an uncle or anything that isn't on the current block chain.
-// Validation validates easy over difficult (dagger takes longer time = difficult)
+// See YP section 4.3.4. "Block Header Validity"
+// Validates a block. Returns an error if the block is invalid.
func (sm *BlockProcessor) ValidateHeader(block, parent *types.Header, checkPow bool) error {
if big.NewInt(int64(len(block.Extra))).Cmp(params.MaximumExtraDataSize) == 1 {
return fmt.Errorf("Block extra data too long (%d)", len(block.Extra))
@@ -298,7 +297,6 @@ func (sm *BlockProcessor) ValidateHeader(block, parent *types.Header, checkPow b
return fmt.Errorf("Difficulty check failed for block %v, %v", block.Difficulty, expd)
}
- // block.gasLimit - parent.gasLimit <= parent.gasLimit / GasLimitBoundDivisor
a := new(big.Int).Sub(block.GasLimit, parent.GasLimit)
a.Abs(a)
b := new(big.Int).Div(parent.GasLimit, params.GasLimitBoundDivisor)