Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
387f6bba
Commit
387f6bba
authored
Mar 14, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
POW fixes
parent
44636e5b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
12 deletions
+1
-12
genesis.go
core/genesis.go
+0
-1
block.go
core/types/block.go
+1
-6
worker.go
miner/worker.go
+0
-4
block.go
pow/block.go
+0
-1
No files found.
core/genesis.go
View file @
387f6bba
...
@@ -31,7 +31,6 @@ func GenesisBlock(db ethutil.Database) *types.Block {
...
@@ -31,7 +31,6 @@ func GenesisBlock(db ethutil.Database) *types.Block {
genesis
.
Header
()
.
GasLimit
=
GenesisGasLimit
genesis
.
Header
()
.
GasLimit
=
GenesisGasLimit
genesis
.
Header
()
.
GasUsed
=
ethutil
.
Big0
genesis
.
Header
()
.
GasUsed
=
ethutil
.
Big0
genesis
.
Header
()
.
Time
=
0
genesis
.
Header
()
.
Time
=
0
genesis
.
Header
()
.
SeedHash
=
make
([]
byte
,
32
)
genesis
.
Header
()
.
MixDigest
=
make
([]
byte
,
32
)
genesis
.
Header
()
.
MixDigest
=
make
([]
byte
,
32
)
genesis
.
Td
=
ethutil
.
Big0
genesis
.
Td
=
ethutil
.
Big0
...
...
core/types/block.go
View file @
387f6bba
...
@@ -40,8 +40,6 @@ type Header struct {
...
@@ -40,8 +40,6 @@ type Header struct {
Time
uint64
Time
uint64
// Extra data
// Extra data
Extra
string
Extra
string
// SeedHash used for light client verification
SeedHash
ethutil
.
Bytes
// Mix digest for quick checking to prevent DOS
// Mix digest for quick checking to prevent DOS
MixDigest
ethutil
.
Bytes
MixDigest
ethutil
.
Bytes
// Nonce
// Nonce
...
@@ -63,7 +61,6 @@ func (self *Header) rlpData(withNonce bool) []interface{} {
...
@@ -63,7 +61,6 @@ func (self *Header) rlpData(withNonce bool) []interface{} {
self
.
GasUsed
,
self
.
GasUsed
,
self
.
Time
,
self
.
Time
,
self
.
Extra
,
self
.
Extra
,
self
.
SeedHash
,
}
}
if
withNonce
{
if
withNonce
{
fields
=
append
(
fields
,
self
.
MixDigest
,
self
.
Nonce
)
fields
=
append
(
fields
,
self
.
MixDigest
,
self
.
Nonce
)
...
@@ -202,7 +199,6 @@ func (self *Block) RlpDataForStorage() interface{} {
...
@@ -202,7 +199,6 @@ func (self *Block) RlpDataForStorage() interface{} {
func
(
self
*
Block
)
Number
()
*
big
.
Int
{
return
self
.
header
.
Number
}
func
(
self
*
Block
)
Number
()
*
big
.
Int
{
return
self
.
header
.
Number
}
func
(
self
*
Block
)
NumberU64
()
uint64
{
return
self
.
header
.
Number
.
Uint64
()
}
func
(
self
*
Block
)
NumberU64
()
uint64
{
return
self
.
header
.
Number
.
Uint64
()
}
func
(
self
*
Block
)
MixDigest
()
[]
byte
{
return
self
.
header
.
MixDigest
}
func
(
self
*
Block
)
MixDigest
()
[]
byte
{
return
self
.
header
.
MixDigest
}
func
(
self
*
Block
)
SeedHash
()
[]
byte
{
return
self
.
header
.
SeedHash
}
func
(
self
*
Block
)
Nonce
()
uint64
{
func
(
self
*
Block
)
Nonce
()
uint64
{
return
binary
.
BigEndian
.
Uint64
(
self
.
header
.
Nonce
)
return
binary
.
BigEndian
.
Uint64
(
self
.
header
.
Nonce
)
}
}
...
@@ -281,10 +277,9 @@ func (self *Header) String() string {
...
@@ -281,10 +277,9 @@ func (self *Header) String() string {
GasUsed: %v
GasUsed: %v
Time: %v
Time: %v
Extra: %v
Extra: %v
SeedHash: %x
MixDigest: %x
MixDigest: %x
Nonce: %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
type
Blocks
[]
*
Block
...
...
miner/worker.go
View file @
387f6bba
...
@@ -7,7 +7,6 @@ import (
...
@@ -7,7 +7,6 @@ import (
"sync"
"sync"
"time"
"time"
"github.com/ethereum/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/ethutil"
...
@@ -154,7 +153,6 @@ func (self *worker) wait() {
...
@@ -154,7 +153,6 @@ func (self *worker) wait() {
if
block
.
Number
()
.
Uint64
()
==
work
.
Number
&&
block
.
Nonce
()
==
0
{
if
block
.
Number
()
.
Uint64
()
==
work
.
Number
&&
block
.
Nonce
()
==
0
{
self
.
current
.
block
.
SetNonce
(
work
.
Nonce
)
self
.
current
.
block
.
SetNonce
(
work
.
Nonce
)
self
.
current
.
block
.
Header
()
.
MixDigest
=
work
.
MixDigest
self
.
current
.
block
.
Header
()
.
MixDigest
=
work
.
MixDigest
self
.
current
.
block
.
Header
()
.
SeedHash
=
work
.
SeedHash
jsonlogger
.
LogJson
(
&
logger
.
EthMinerNewBlock
{
jsonlogger
.
LogJson
(
&
logger
.
EthMinerNewBlock
{
BlockHash
:
ethutil
.
Bytes2Hex
(
block
.
Hash
()),
BlockHash
:
ethutil
.
Bytes2Hex
(
block
.
Hash
()),
...
@@ -191,8 +189,6 @@ func (self *worker) commitNewWork() {
...
@@ -191,8 +189,6 @@ func (self *worker) commitNewWork() {
defer
self
.
mu
.
Unlock
()
defer
self
.
mu
.
Unlock
()
block
:=
self
.
chain
.
NewBlock
(
self
.
coinbase
)
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
)
self
.
current
=
env
(
block
,
self
.
eth
)
parent
:=
self
.
chain
.
GetBlock
(
self
.
current
.
block
.
ParentHash
())
parent
:=
self
.
chain
.
GetBlock
(
self
.
current
.
block
.
ParentHash
())
...
...
pow/block.go
View file @
387f6bba
...
@@ -11,7 +11,6 @@ type Block interface {
...
@@ -11,7 +11,6 @@ type Block interface {
HashNoNonce
()
[]
byte
HashNoNonce
()
[]
byte
Nonce
()
uint64
Nonce
()
uint64
MixDigest
()
[]
byte
MixDigest
()
[]
byte
SeedHash
()
[]
byte
NumberU64
()
uint64
NumberU64
()
uint64
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment