aboutsummaryrefslogtreecommitdiffstats
path: root/core/block_processor.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-04-23 17:49:51 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-04-23 17:49:51 +0800
commit2fe54ab233c0cd1bf09b49085477c961dcc1980f (patch)
tree5e18ad0907320997a28c848a7740e680a5fa7fd6 /core/block_processor.go
parent0071fbed8c1525bedf43e3bbd444b11e64b87f27 (diff)
parent49da462e92fd597ba6242231b9dc0809e683862b (diff)
downloadgo-tangerine-2fe54ab233c0cd1bf09b49085477c961dcc1980f.tar
go-tangerine-2fe54ab233c0cd1bf09b49085477c961dcc1980f.tar.gz
go-tangerine-2fe54ab233c0cd1bf09b49085477c961dcc1980f.tar.bz2
go-tangerine-2fe54ab233c0cd1bf09b49085477c961dcc1980f.tar.lz
go-tangerine-2fe54ab233c0cd1bf09b49085477c961dcc1980f.tar.xz
go-tangerine-2fe54ab233c0cd1bf09b49085477c961dcc1980f.tar.zst
go-tangerine-2fe54ab233c0cd1bf09b49085477c961dcc1980f.zip
Merge pull request #779 from Gustav-Simonsson/block_tests_reloaded
Block tests reloaded
Diffstat (limited to 'core/block_processor.go')
-rw-r--r--core/block_processor.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index 28636a725..f33f0d433 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -219,14 +219,21 @@ func (sm *BlockProcessor) processWithParent(block, parent *types.Block) (logs st
// can be used by light clients to make sure they've received the correct Txs
txSha := types.DeriveSha(block.Transactions())
if txSha != header.TxHash {
- err = fmt.Errorf("validating transaction root. received=%x got=%x", header.TxHash, txSha)
+ err = fmt.Errorf("invalid transaction root hash. received=%x calculated=%x", header.TxHash, txSha)
return
}
// Tre receipt Trie's root (R = (Tr [[H1, R1], ... [Hn, R1]]))
receiptSha := types.DeriveSha(receipts)
if receiptSha != header.ReceiptHash {
- err = fmt.Errorf("validating receipt root. received=%x got=%x", header.ReceiptHash, receiptSha)
+ err = fmt.Errorf("invalid receipt root hash. received=%x calculated=%x", header.ReceiptHash, receiptSha)
+ return
+ }
+
+ // Verify UncleHash before running other uncle validations
+ unclesSha := block.CalculateUnclesHash()
+ if unclesSha != header.UncleHash {
+ err = fmt.Errorf("invalid uncles root hash. received=%x calculated=%x", header.UncleHash, unclesSha)
return
}