diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-10 23:45:16 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-10 23:45:16 +0800 |
commit | 1b98cbbfa4f587107fa15fccde7d22102ea4b1c0 (patch) | |
tree | 367be45e14b7d1a1ff3a62e0fdb949156e9cc71d /core/block_manager.go | |
parent | 4082c8b61d1e9cc57d9da9b9da5c36ff84895d74 (diff) | |
download | go-tangerine-1b98cbbfa4f587107fa15fccde7d22102ea4b1c0.tar.gz go-tangerine-1b98cbbfa4f587107fa15fccde7d22102ea4b1c0.tar.zst go-tangerine-1b98cbbfa4f587107fa15fccde7d22102ea4b1c0.zip |
Moved pow
Diffstat (limited to 'core/block_manager.go')
-rw-r--r-- | core/block_manager.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/block_manager.go b/core/block_manager.go index 4c1cea35a..6f952f9f8 100644 --- a/core/block_manager.go +++ b/core/block_manager.go @@ -14,6 +14,8 @@ import ( "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/pow" + "github.com/ethereum/go-ethereum/pow/ezp" "github.com/ethereum/go-ethereum/state" "github.com/ethereum/go-ethereum/wire" ) @@ -55,7 +57,7 @@ type BlockManager struct { // non-persistent key/value memory storage mem map[string]*big.Int // Proof of work used for validating - Pow PoW + Pow pow.PoW // The ethereum manager interface eth EthManager // The managed states @@ -78,7 +80,7 @@ type BlockManager struct { func NewBlockManager(ethereum EthManager) *BlockManager { sm := &BlockManager{ mem: make(map[string]*big.Int), - Pow: &EasyPow{}, + Pow: ezp.New(), eth: ethereum, bc: ethereum.ChainManager(), } @@ -327,7 +329,7 @@ func (sm *BlockManager) ValidateBlock(block, parent *types.Block) error { */ // Verify the nonce of the block. Return an error if it's not valid - if !sm.Pow.Verify(block.HashNoNonce(), block.Difficulty, block.Nonce) { + if !sm.Pow.Verify(block /*block.HashNoNonce(), block.Difficulty, block.Nonce*/) { return ValidationError("Block's nonce is invalid (= %v)", ethutil.Bytes2Hex(block.Nonce)) } |