good morning!!!!

Skip to content
Snippets Groups Projects
Commit 697c2b5d authored by Gustav Simonsson's avatar Gustav Simonsson
Browse files

Correct block parent timestamp check and typos

parent 4dc283c0
No related branches found
No related tags found
No related merge requests found
...@@ -206,7 +206,7 @@ func (sm *BlockProcessor) ProcessWithParent(block, parent *types.Block) (td *big ...@@ -206,7 +206,7 @@ func (sm *BlockProcessor) ProcessWithParent(block, parent *types.Block) (td *big
return return
} }
if err = sm.AccumelateRewards(state, block, parent); err != nil { if err = sm.AccumulateRewards(state, block, parent); err != nil {
return return
} }
...@@ -248,8 +248,8 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error { ...@@ -248,8 +248,8 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
} }
diff := block.Header().Time - parent.Header().Time diff := block.Header().Time - parent.Header().Time
if diff < 0 { if diff <= 0 {
return ValidationError("Block timestamp less then prev block %v (%v - %v)", diff, block.Header().Time, sm.bc.CurrentBlock().Header().Time) 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() { if block.Time() > time.Now().Unix() {
...@@ -264,7 +264,7 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error { ...@@ -264,7 +264,7 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
return nil 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) reward := new(big.Int).Set(BlockReward)
ancestors := set.New() ancestors := set.New()
...@@ -326,7 +326,7 @@ func (sm *BlockProcessor) GetMessages(block *types.Block) (messages []*state.Mes ...@@ -326,7 +326,7 @@ func (sm *BlockProcessor) GetMessages(block *types.Block) (messages []*state.Mes
defer state.Reset() defer state.Reset()
sm.TransitionState(state, parent, block) sm.TransitionState(state, parent, block)
sm.AccumelateRewards(state, block, parent) sm.AccumulateRewards(state, block, parent)
return state.Manifest().Messages, nil return state.Manifest().Messages, nil
} }
...@@ -347,7 +347,7 @@ func (sm *BlockProcessor) GetLogs(block *types.Block) (logs state.Logs, err erro ...@@ -347,7 +347,7 @@ func (sm *BlockProcessor) GetLogs(block *types.Block) (logs state.Logs, err erro
defer state.Reset() defer state.Reset()
sm.TransitionState(state, parent, block) sm.TransitionState(state, parent, block)
sm.AccumelateRewards(state, block, parent) sm.AccumulateRewards(state, block, parent)
return state.Logs(), nil return state.Logs(), nil
} }
...@@ -206,7 +206,7 @@ func (self *Miner) mine() { ...@@ -206,7 +206,7 @@ func (self *Miner) mine() {
block.SetReceipts(receipts) block.SetReceipts(receipts)
// Accumulate the rewards included for this block // Accumulate the rewards included for this block
blockProcessor.AccumelateRewards(state, block, parent) blockProcessor.AccumulateRewards(state, block, parent)
state.Update(ethutil.Big0) state.Update(ethutil.Big0)
block.SetRoot(state.Root()) block.SetRoot(state.Root())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment