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
0636e17d
Commit
0636e17d
authored
Apr 09, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added default registrar
parent
c6b25a40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
9 deletions
+2
-9
js.go
cmd/geth/js.go
+1
-0
chain_manager.go
core/chain_manager.go
+1
-9
No files found.
cmd/geth/js.go
View file @
0636e17d
...
...
@@ -136,6 +136,7 @@ var net = web3.net;
utils
.
Fatalf
(
"Error setting namespaces: %v"
,
err
)
}
js
.
re
.
Eval
(
registrar
+
"registrar = new Registrar("
+
registrarAddr
+
");"
)
}
func
(
self
*
jsre
)
ConfirmTransaction
(
tx
*
types
.
Transaction
)
bool
{
...
...
core/chain_manager.go
View file @
0636e17d
...
...
@@ -50,15 +50,7 @@ func CalcDifficulty(block, parent *types.Header) *big.Int {
}
func
CalculateTD
(
block
,
parent
*
types
.
Block
)
*
big
.
Int
{
uncleDiff
:=
new
(
big
.
Int
)
for
_
,
uncle
:=
range
block
.
Uncles
()
{
uncleDiff
=
uncleDiff
.
Add
(
uncleDiff
,
uncle
.
Difficulty
)
}
// TD(genesis_block) = 0 and TD(B) = TD(B.parent) + sum(u.difficulty for u in B.uncles) + B.difficulty
td
:=
new
(
big
.
Int
)
td
=
td
.
Add
(
parent
.
Td
,
uncleDiff
)
td
=
td
.
Add
(
td
,
block
.
Header
()
.
Difficulty
)
td
:=
new
(
big
.
Int
)
.
Add
(
parent
.
Td
,
block
.
Header
()
.
Difficulty
)
return
td
}
...
...
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