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
8dfa4f46
Unverified
Commit
8dfa4f46
authored
Apr 26, 2018
by
Martin Holst Swende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evm/main: use blocknumber from genesis
parent
86be91b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
runner.go
cmd/evm/runner.go
+10
-7
No files found.
cmd/evm/runner.go
View file @
8dfa4f46
...
...
@@ -21,12 +21,12 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"math/big"
"os"
goruntime
"runtime"
"runtime/pprof"
"time"
goruntime
"runtime"
"github.com/ethereum/go-ethereum/cmd/evm/internal/compiler"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
...
...
@@ -86,6 +86,7 @@ func runCmd(ctx *cli.Context) error {
chainConfig
*
params
.
ChainConfig
sender
=
common
.
BytesToAddress
([]
byte
(
"sender"
))
receiver
=
common
.
BytesToAddress
([]
byte
(
"receiver"
))
blockNumber
uint64
)
if
ctx
.
GlobalBool
(
MachineFlag
.
Name
)
{
tracer
=
NewJSONLogger
(
logconfig
,
os
.
Stdout
)
...
...
@@ -101,6 +102,7 @@ func runCmd(ctx *cli.Context) error {
genesis
:=
gen
.
ToBlock
(
db
)
statedb
,
_
=
state
.
New
(
genesis
.
Root
(),
state
.
NewDatabase
(
db
))
chainConfig
=
gen
.
Config
blockNumber
=
gen
.
Number
}
else
{
db
,
_
:=
ethdb
.
NewMemDatabase
()
statedb
,
_
=
state
.
New
(
common
.
Hash
{},
state
.
NewDatabase
(
db
))
...
...
@@ -156,11 +158,12 @@ func runCmd(ctx *cli.Context) error {
initialGas
:=
ctx
.
GlobalUint64
(
GasFlag
.
Name
)
runtimeConfig
:=
runtime
.
Config
{
Origin
:
sender
,
State
:
statedb
,
GasLimit
:
initialGas
,
GasPrice
:
utils
.
GlobalBig
(
ctx
,
PriceFlag
.
Name
),
Value
:
utils
.
GlobalBig
(
ctx
,
ValueFlag
.
Name
),
Origin
:
sender
,
State
:
statedb
,
GasLimit
:
initialGas
,
GasPrice
:
utils
.
GlobalBig
(
ctx
,
PriceFlag
.
Name
),
Value
:
utils
.
GlobalBig
(
ctx
,
ValueFlag
.
Name
),
BlockNumber
:
new
(
big
.
Int
)
.
SetUint64
(
blockNumber
),
EVMConfig
:
vm
.
Config
{
Tracer
:
tracer
,
Debug
:
ctx
.
GlobalBool
(
DebugFlag
.
Name
)
||
ctx
.
GlobalBool
(
MachineFlag
.
Name
),
...
...
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