diff options
author | zelig <viktor.tron@gmail.com> | 2014-06-23 20:07:43 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2014-06-23 20:07:43 +0800 |
commit | f58c7ac5a6f5d77649c1c07dce94bf6d5c146c31 (patch) | |
tree | 31e286974108e02b29ed5eff0a73646f605998c2 /ethereum.go | |
parent | 63157c798d613f1ca638597515bb89768e2c1aad (diff) | |
parent | d890258af6de8c5ef9701826fb4ee7c353788ad5 (diff) | |
download | dexon-f58c7ac5a6f5d77649c1c07dce94bf6d5c146c31.tar dexon-f58c7ac5a6f5d77649c1c07dce94bf6d5c146c31.tar.gz dexon-f58c7ac5a6f5d77649c1c07dce94bf6d5c146c31.tar.bz2 dexon-f58c7ac5a6f5d77649c1c07dce94bf6d5c146c31.tar.lz dexon-f58c7ac5a6f5d77649c1c07dce94bf6d5c146c31.tar.xz dexon-f58c7ac5a6f5d77649c1c07dce94bf6d5c146c31.tar.zst dexon-f58c7ac5a6f5d77649c1c07dce94bf6d5c146c31.zip |
merge upstream
Diffstat (limited to 'ethereum.go')
-rw-r--r-- | ethereum.go | 18 |
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 } |