|
|
@ -129,20 +129,14 @@ func (self *BlockProcessor) ApplyTransactions(coinbase *state.StateObject, state |
|
|
|
cumulativeSum = new(big.Int) |
|
|
|
cumulativeSum = new(big.Int) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
done: |
|
|
|
for _, tx := range txs { |
|
|
|
for i, tx := range txs { |
|
|
|
|
|
|
|
receipt, txGas, err := self.ApplyTransaction(coinbase, state, block, tx, totalUsedGas, transientProcess) |
|
|
|
receipt, txGas, err := self.ApplyTransaction(coinbase, state, block, tx, totalUsedGas, transientProcess) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, nil, nil, err |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch { |
|
|
|
switch { |
|
|
|
case IsNonceErr(err): |
|
|
|
case IsNonceErr(err): |
|
|
|
err = nil // ignore error
|
|
|
|
return nil, nil, nil, nil, err |
|
|
|
continue |
|
|
|
|
|
|
|
case IsGasLimitErr(err): |
|
|
|
case IsGasLimitErr(err): |
|
|
|
unhandled = txs[i:] |
|
|
|
return nil, nil, nil, nil, err |
|
|
|
|
|
|
|
|
|
|
|
break done |
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
statelogger.Infoln(err) |
|
|
|
statelogger.Infoln(err) |
|
|
|
erroneous = append(erroneous, tx) |
|
|
|
erroneous = append(erroneous, tx) |
|
|
@ -260,9 +254,8 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error { |
|
|
|
return fmt.Errorf("Difficulty check failed for block %v, %v", block.Header().Difficulty, expd) |
|
|
|
return fmt.Errorf("Difficulty check failed for block %v, %v", block.Header().Difficulty, expd) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
diff := block.Header().Time - parent.Header().Time |
|
|
|
if block.Time() < parent.Time() { |
|
|
|
if diff <= 0 { |
|
|
|
return ValidationError("Block timestamp not after prev block (%v - %v)", block.Header().Time, parent.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() { |
|
|
|