Miner fixes and updates (including miner)

This commit is contained in:
obscuren
2015-03-05 09:14:58 +01:00
parent 15f491e500
commit c47866d251
10 changed files with 45 additions and 32 deletions

View File

@ -253,9 +253,6 @@ func (sm *BlockProcessor) ValidateHeader(block, parent *types.Header) error {
return fmt.Errorf("Difficulty check failed for block %v, %v", block.Difficulty, expd)
}
//expl := CalcGasLimit(parent, block)
//if expl.Cmp(block.Header().GasLimit) != 0 {
// block.gasLimit - parent.gasLimit <= parent.gasLimit / 1024
a := new(big.Int).Sub(block.GasLimit, parent.GasLimit)
b := new(big.Int).Div(parent.GasLimit, big.NewInt(1024))
@ -263,8 +260,8 @@ func (sm *BlockProcessor) ValidateHeader(block, parent *types.Header) error {
return fmt.Errorf("GasLimit check failed for block %v (%v > %v)", block.GasLimit, a, b)
}
if block.Time < parent.Time {
return ValidationError("Block timestamp not after prev block (%v - %v)", block.Time, parent.Time)
if block.Time <= parent.Time {
return ValidationError("Block timestamp not after or equal to prev block (%v - %v)", block.Time, parent.Time)
}
if int64(block.Time) > time.Now().Unix() {