aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethereum.go')
-rw-r--r--ethereum.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/ethereum.go b/ethereum.go
index 1de671712..0dde28e51 100644
--- a/ethereum.go
+++ b/ethereum.go
@@ -115,6 +115,24 @@ func New(caps Caps, usePnp bool) (*Ethereum, error) {
return ethereum, nil
}
+// Replay block
+func (self *Ethereum) BlockDo(hash []byte) error {
+ block := self.blockChain.GetBlock(hash)
+ if block == nil {
+ return fmt.Errorf("unknown block %x", hash)
+ }
+
+ parent := self.blockChain.GetBlock(block.PrevHash)
+
+ _, err := self.stateManager.ApplyDiff(parent.State(), parent, block)
+ if err != nil {
+ return err
+ }
+
+ return nil
+
+}
+
func (s *Ethereum) Reactor() *ethutil.ReactorEngine {
return s.reactor
}