aboutsummaryrefslogtreecommitdiffstats
path: root/core/types.go
diff options
context:
space:
mode:
authorzsfelfoldi <zsfelfoldi@gmail.com>2015-12-16 11:26:23 +0800
committerzsfelfoldi <zsfelfoldi@gmail.com>2016-03-10 21:57:32 +0800
commit73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00 (patch)
tree6109fe60cfde0b20f8d1608026d9a2805278c1e9 /core/types.go
parentbff9ceb6b88021c1ba5bc02a56ec88c275e62e76 (diff)
downloaddexon-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar
dexon-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.gz
dexon-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.bz2
dexon-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.lz
dexon-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.xz
dexon-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.zst
dexon-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.zip
core: create a header chain structure shared by core.BlockChain and light.LightChain
Diffstat (limited to 'core/types.go')
-rw-r--r--core/types.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/types.go b/core/types.go
index 027f628b1..60eb15662 100644
--- a/core/types.go
+++ b/core/types.go
@@ -38,14 +38,22 @@ import (
// ValidateHeader validates the given header and parent and returns an error
// if it failed to do so.
//
-// ValidateStack validates the given statedb and optionally the receipts and
+// ValidateState validates the given statedb and optionally the receipts and
// gas used. The implementor should decide what to do with the given input.
type Validator interface {
+ HeaderValidator
ValidateBlock(block *types.Block) error
- ValidateHeader(header, parent *types.Header, checkPow bool) error
ValidateState(block, parent *types.Block, state *state.StateDB, receipts types.Receipts, usedGas *big.Int) error
}
+// HeaderValidator is an interface for validating headers only
+//
+// ValidateHeader validates the given header and parent and returns an error
+// if it failed to do so.
+type HeaderValidator interface {
+ ValidateHeader(header, parent *types.Header, checkPow bool) error
+}
+
// Processor is an interface for processing blocks using a given initial state.
//
// Process takes the block to be processed and the statedb upon which the