aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-02-06 04:23:56 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-02-06 04:23:56 +0800
commit47129428fe346b0b5595d3c5ffc88432071af4a3 (patch)
treee3c9ec0f5b66a82f78aad63ae7e6b40043349989 /core
parent2f30a27b2be39197dd6e9f6aabe6fe11026bd2f6 (diff)
parent697c2b5dc16653228c5264d01c08163cebda3aeb (diff)
downloadgo-tangerine-47129428fe346b0b5595d3c5ffc88432071af4a3.tar
go-tangerine-47129428fe346b0b5595d3c5ffc88432071af4a3.tar.gz
go-tangerine-47129428fe346b0b5595d3c5ffc88432071af4a3.tar.bz2
go-tangerine-47129428fe346b0b5595d3c5ffc88432071af4a3.tar.lz
go-tangerine-47129428fe346b0b5595d3c5ffc88432071af4a3.tar.xz
go-tangerine-47129428fe346b0b5595d3c5ffc88432071af4a3.tar.zst
go-tangerine-47129428fe346b0b5595d3c5ffc88432071af4a3.zip
Merge pull request #290 from Gustav-Simonsson/correct_block_parent_timestamp_check
Correct block parent timestamp check and typos
Diffstat (limited to 'core')
-rw-r--r--core/block_processor.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index 349de85e0..e3f764616 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -220,7 +220,7 @@ func (sm *BlockProcessor) ProcessWithParent(block, parent *types.Block) (td *big
return
}
- if err = sm.AccumelateRewards(state, block, parent); err != nil {
+ if err = sm.AccumulateRewards(state, block, parent); err != nil {
return
}
@@ -261,8 +261,8 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
}
diff := block.Header().Time - parent.Header().Time
- if diff < 0 {
- return ValidationError("Block timestamp less then prev block %v (%v - %v)", diff, block.Header().Time, sm.bc.CurrentBlock().Header().Time)
+ if diff <= 0 {
+ return ValidationError("Block timestamp not after prev block %v (%v - %v)", diff, block.Header().Time, sm.bc.CurrentBlock().Header().Time)
}
if block.Time() > time.Now().Unix() {
@@ -277,7 +277,7 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
return nil
}
-func (sm *BlockProcessor) AccumelateRewards(statedb *state.StateDB, block, parent *types.Block) error {
+func (sm *BlockProcessor) AccumulateRewards(statedb *state.StateDB, block, parent *types.Block) error {
reward := new(big.Int).Set(BlockReward)
ancestors := set.New()
@@ -335,7 +335,7 @@ func (sm *BlockProcessor) GetMessages(block *types.Block) (messages []*state.Mes
defer state.Reset()
sm.TransitionState(state, parent, block)
- sm.AccumelateRewards(state, block, parent)
+ sm.AccumulateRewards(state, block, parent)
return state.Manifest().Messages, nil
}
@@ -356,7 +356,7 @@ func (sm *BlockProcessor) GetLogs(block *types.Block) (logs state.Logs, err erro
defer state.Reset()
sm.TransitionState(state, parent, block)
- sm.AccumelateRewards(state, block, parent)
+ sm.AccumulateRewards(state, block, parent)
return state.Logs(), nil
}