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
34284b75
Commit
34284b75
authored
Jun 23, 2014
by
zelig
Browse files
Options
Browse Files
Download
Plain Diff
merge upstream
parents
10247665
176b7802
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
javascript_runtime.go
ethereum/javascript_runtime.go
+17
-1
cmd.go
utils/cmd.go
+0
-3
No files found.
ethereum/javascript_runtime.go
View file @
34284b75
package
main
package
main
import
(
import
(
"fmt"
"fmt"
...
@@ -144,6 +144,7 @@ func (self *JSRE) initStdFuncs() {
...
@@ -144,6 +144,7 @@ func (self *JSRE) initStdFuncs() {
eth
.
Set
(
"require"
,
self
.
require
)
eth
.
Set
(
"require"
,
self
.
require
)
eth
.
Set
(
"stopMining"
,
self
.
stopMining
)
eth
.
Set
(
"stopMining"
,
self
.
stopMining
)
eth
.
Set
(
"startMining"
,
self
.
startMining
)
eth
.
Set
(
"startMining"
,
self
.
startMining
)
eth
.
Set
(
"blockDo"
,
self
.
execBlock
)
}
}
/*
/*
...
@@ -213,3 +214,18 @@ func (self *JSRE) require(call otto.FunctionCall) otto.Value {
...
@@ -213,3 +214,18 @@ func (self *JSRE) require(call otto.FunctionCall) otto.Value {
return
t
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 @
34284b75
...
@@ -198,9 +198,6 @@ func StartMining(ethereum *eth.Ethereum) bool {
...
@@ -198,9 +198,6 @@ func StartMining(ethereum *eth.Ethereum) bool {
miner
=
ethminer
.
NewDefaultMiner
(
addr
,
ethereum
)
miner
=
ethminer
.
NewDefaultMiner
(
addr
,
ethereum
)
// Give it some time to connect with peers
// Give it some time to connect with peers
time
.
Sleep
(
3
*
time
.
Second
)
time
.
Sleep
(
3
*
time
.
Second
)
for
ethereum
.
IsUpToDate
()
==
false
{
time
.
Sleep
(
5
*
time
.
Second
)
}
logger
.
Infoln
(
"Miner started"
)
logger
.
Infoln
(
"Miner started"
)
miner
:=
ethminer
.
NewDefaultMiner
(
addr
,
ethereum
)
miner
:=
ethminer
.
NewDefaultMiner
(
addr
,
ethereum
)
miner
.
Start
()
miner
.
Start
()
...
...
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