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
bcb88e73
Commit
bcb88e73
authored
Jun 23, 2014
by
Maran
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com:ethereum/go-ethereum into develop
parents
f6aabb7a
176b7802
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
javascript_runtime.go
ethereum/javascript_runtime.go
+16
-0
cmd.go
utils/cmd.go
+5
-3
No files found.
ethereum/javascript_runtime.go
View file @
bcb88e73
...
...
@@ -138,6 +138,7 @@ func (self *JSRE) initStdFuncs() {
eth
.
Set
(
"require"
,
self
.
require
)
eth
.
Set
(
"stopMining"
,
self
.
stopMining
)
eth
.
Set
(
"startMining"
,
self
.
startMining
)
eth
.
Set
(
"blockDo"
,
self
.
execBlock
)
}
/*
...
...
@@ -207,3 +208,18 @@ func (self *JSRE) require(call otto.FunctionCall) otto.Value {
return
t
}
func
(
self
*
JSRE
)
execBlock
(
call
otto
.
FunctionCall
)
otto
.
Value
{
hash
,
err
:=
call
.
Argument
(
0
)
.
ToString
()
if
err
!=
nil
{
return
otto
.
UndefinedValue
()
}
err
=
self
.
ethereum
.
BlockDo
(
ethutil
.
FromHex
(
hash
))
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
otto
.
FalseValue
()
}
return
otto
.
TrueValue
()
}
utils/cmd.go
View file @
bcb88e73
...
...
@@ -38,9 +38,11 @@ func DoMining(ethereum *eth.Ethereum) {
// Give it some time to connect with peers
time
.
Sleep
(
3
*
time
.
Second
)
for
ethereum
.
IsUpToDate
()
==
false
{
time
.
Sleep
(
5
*
time
.
Second
)
}
/*
for ethereum.IsUpToDate() == false {
time.Sleep(5 * time.Second)
}
*/
ethutil
.
Config
.
Log
.
Infoln
(
"Miner started"
)
...
...
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