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
25e6c4ef
Commit
25e6c4ef
authored
Jan 06, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjusted difficulty and skip get tx messages
parent
a76b7dad
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
2 deletions
+3
-2
block_processor.go
core/block_processor.go
+1
-0
chain_manager.go
core/chain_manager.go
+1
-1
protocol.go
eth/protocol.go
+1
-1
No files found.
core/block_processor.go
View file @
25e6c4ef
...
...
@@ -264,6 +264,7 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
expd
:=
CalcDifficulty
(
block
,
parent
)
if
expd
.
Cmp
(
block
.
Header
()
.
Difficulty
)
<
0
{
fmt
.
Println
(
"parent
\n
"
,
parent
)
return
fmt
.
Errorf
(
"Difficulty check failed for block %v, %v"
,
block
.
Header
()
.
Difficulty
,
expd
)
}
...
...
core/chain_manager.go
View file @
25e6c4ef
...
...
@@ -25,7 +25,7 @@ func CalcDifficulty(block, parent *types.Block) *big.Int {
bh
,
ph
:=
block
.
Header
(),
parent
.
Header
()
adjust
:=
new
(
big
.
Int
)
.
Rsh
(
ph
.
Difficulty
,
10
)
if
bh
.
Time
>=
ph
.
Time
+
5
{
if
bh
.
Time
>=
ph
.
Time
+
13
{
diff
.
Sub
(
ph
.
Difficulty
,
adjust
)
}
else
{
diff
.
Add
(
ph
.
Difficulty
,
adjust
)
...
...
eth/protocol.go
View file @
25e6c4ef
...
...
@@ -122,7 +122,7 @@ func (self *ethProtocol) handle() error {
defer
msg
.
Discard
()
switch
msg
.
Code
{
case
GetTxMsg
:
// ignore
case
StatusMsg
:
return
self
.
protoError
(
ErrExtraStatusMsg
,
""
)
...
...
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