merge upstream
This commit is contained in:
18
utils/cmd.go
18
utils/cmd.go
@ -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
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user