merge upstream

This commit is contained in:
zelig
2014-06-25 16:20:26 +01:00
11 changed files with 210 additions and 39 deletions

View File

@ -219,3 +219,21 @@ func StopMining(ethereum *eth.Ethereum) bool {
}
return false
}
// Replay block
func BlockDo(ethereum *eth.Ethereum, hash []byte) error {
block := ethereum.BlockChain().GetBlock(hash)
if block == nil {
return fmt.Errorf("unknown block %x", hash)
}
parent := ethereum.BlockChain().GetBlock(block.PrevHash)
_, err := ethereum.StateManager().ApplyDiff(parent.State(), parent, block)
if err != nil {
return err
}
return nil
}