aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-14 23:37:57 +0800
committerobscuren <geffobscura@gmail.com>2015-03-14 23:37:57 +0800
commit387f6bba3e221dac6f9884b3f9aba98d6b8591cf (patch)
tree0d6b19c76dbde906d10cd6d9f66add1cba161be4
parent44636e5b824514f90e8fefdedf3ab6bcd2cf287a (diff)
downloadgo-tangerine-387f6bba3e221dac6f9884b3f9aba98d6b8591cf.tar.gz
go-tangerine-387f6bba3e221dac6f9884b3f9aba98d6b8591cf.tar.zst
go-tangerine-387f6bba3e221dac6f9884b3f9aba98d6b8591cf.zip
POW fixes
-rw-r--r--core/genesis.go1
-rw-r--r--core/types/block.go7
-rw-r--r--miner/worker.go4
-rw-r--r--pow/block.go1
4 files changed, 1 insertions, 12 deletions
diff --git a/core/genesis.go b/core/genesis.go
index a3d701f9f..9c82a28c8 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -31,7 +31,6 @@ func GenesisBlock(db ethutil.Database) *types.Block {
genesis.Header().GasLimit = GenesisGasLimit
genesis.Header().GasUsed = ethutil.Big0
genesis.Header().Time = 0
- genesis.Header().SeedHash = make([]byte, 32)
genesis.Header().MixDigest = make([]byte, 32)
genesis.Td = ethutil.Big0
diff --git a/core/types/block.go b/core/types/block.go
index 31c7c2b87..50973c804 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -40,8 +40,6 @@ type Header struct {
Time uint64
// Extra data
Extra string
- // SeedHash used for light client verification
- SeedHash ethutil.Bytes
// Mix digest for quick checking to prevent DOS
MixDigest ethutil.Bytes
// Nonce
@@ -63,7 +61,6 @@ func (self *Header) rlpData(withNonce bool) []interface{} {
self.GasUsed,
self.Time,
self.Extra,
- self.SeedHash,
}
if withNonce {
fields = append(fields, self.MixDigest, self.Nonce)
@@ -202,7 +199,6 @@ func (self *Block) RlpDataForStorage() interface{} {
func (self *Block) Number() *big.Int { return self.header.Number }
func (self *Block) NumberU64() uint64 { return self.header.Number.Uint64() }
func (self *Block) MixDigest() []byte { return self.header.MixDigest }
-func (self *Block) SeedHash() []byte { return self.header.SeedHash }
func (self *Block) Nonce() uint64 {
return binary.BigEndian.Uint64(self.header.Nonce)
}
@@ -281,10 +277,9 @@ func (self *Header) String() string {
GasUsed: %v
Time: %v
Extra: %v
- SeedHash: %x
MixDigest: %x
Nonce: %x`,
- self.ParentHash, self.UncleHash, self.Coinbase, self.Root, self.TxHash, self.ReceiptHash, self.Bloom, self.Difficulty, self.Number, self.GasLimit, self.GasUsed, self.Time, self.Extra, self.SeedHash, self.MixDigest, self.Nonce)
+ self.ParentHash, self.UncleHash, self.Coinbase, self.Root, self.TxHash, self.ReceiptHash, self.Bloom, self.Difficulty, self.Number, self.GasLimit, self.GasUsed, self.Time, self.Extra, self.MixDigest, self.Nonce)
}
type Blocks []*Block
diff --git a/miner/worker.go b/miner/worker.go
index 7ef113fd4..5c4a13698 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -7,7 +7,6 @@ import (
"sync"
"time"
- "github.com/ethereum/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
@@ -154,7 +153,6 @@ func (self *worker) wait() {
if block.Number().Uint64() == work.Number && block.Nonce() == 0 {
self.current.block.SetNonce(work.Nonce)
self.current.block.Header().MixDigest = work.MixDigest
- self.current.block.Header().SeedHash = work.SeedHash
jsonlogger.LogJson(&logger.EthMinerNewBlock{
BlockHash: ethutil.Bytes2Hex(block.Hash()),
@@ -191,8 +189,6 @@ func (self *worker) commitNewWork() {
defer self.mu.Unlock()
block := self.chain.NewBlock(self.coinbase)
- seednum := ethash.GetSeedBlockNum(block.NumberU64())
- block.Header().SeedHash = self.chain.GetBlockByNumber(seednum).SeedHash()
self.current = env(block, self.eth)
parent := self.chain.GetBlock(self.current.block.ParentHash())
diff --git a/pow/block.go b/pow/block.go
index 3bc63978b..136e4bf8d 100644
--- a/pow/block.go
+++ b/pow/block.go
@@ -11,7 +11,6 @@ type Block interface {
HashNoNonce() []byte
Nonce() uint64
MixDigest() []byte
- SeedHash() []byte
NumberU64() uint64
}