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
c01d4c2f
Commit
c01d4c2f
authored
Mar 11, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lowered default gas price and increased default gas limit
parent
2da7af4b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
state_transition.go
core/state_transition.go
+2
-0
api.go
rpc/api.go
+2
-3
xeth.go
xeth/xeth.go
+13
-7
No files found.
core/state_transition.go
View file @
c01d4c2f
...
@@ -199,6 +199,8 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
...
@@ -199,6 +199,8 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
dataGas
.
Mul
(
dataGas
,
vm
.
GasCreateByte
)
dataGas
.
Mul
(
dataGas
,
vm
.
GasCreateByte
)
if
err
:=
self
.
UseGas
(
dataGas
);
err
==
nil
{
if
err
:=
self
.
UseGas
(
dataGas
);
err
==
nil
{
ref
.
SetCode
(
ret
)
ref
.
SetCode
(
ret
)
}
else
{
statelogger
.
Infoln
(
"Insufficient gas for creating code. Require"
,
dataGas
,
"and have"
,
self
.
gas
)
}
}
}
}
}
else
{
}
else
{
...
...
rpc/api.go
View file @
c01d4c2f
...
@@ -21,8 +21,8 @@ import (
...
@@ -21,8 +21,8 @@ import (
)
)
var
(
var
(
defaultGasPrice
=
big
.
NewInt
(
1
000
0000000000
)
defaultGasPrice
=
big
.
NewInt
(
1
5
0000000000
)
defaultGas
=
big
.
NewInt
(
50000
)
defaultGas
=
big
.
NewInt
(
50000
0
)
filterTickerTime
=
15
*
time
.
Second
filterTickerTime
=
15
*
time
.
Second
)
)
...
@@ -252,7 +252,6 @@ func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) (err error)
...
@@ -252,7 +252,6 @@ func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) (err error)
*/
*/
// TODO: align default values to have the same type, e.g. not depend on
// TODO: align default values to have the same type, e.g. not depend on
// ethutil.Value conversions later on
// ethutil.Value conversions later on
fmt
.
Println
(
"gas"
,
args
.
Gas
)
if
args
.
Gas
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
if
args
.
Gas
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
args
.
Gas
=
defaultGas
args
.
Gas
=
defaultGas
}
}
...
...
xeth/xeth.go
View file @
c01d4c2f
...
@@ -293,14 +293,12 @@ func (self *XEth) PushTx(encodedTx string) (string, error) {
...
@@ -293,14 +293,12 @@ func (self *XEth) PushTx(encodedTx string) (string, error) {
return
toHex
(
tx
.
Hash
()),
nil
return
toHex
(
tx
.
Hash
()),
nil
}
}
func
(
self
*
XEth
)
Call
(
fromStr
,
toStr
,
valueStr
,
gasStr
,
gasPriceStr
,
dataStr
string
)
(
string
,
error
)
{
var
(
if
len
(
gasStr
)
==
0
{
defaultGasPrice
=
big
.
NewInt
(
10000000000000
)
gasStr
=
"100000"
defaultGas
=
big
.
NewInt
(
90000
)
}
)
if
len
(
gasPriceStr
)
==
0
{
gasPriceStr
=
"1"
}
func
(
self
*
XEth
)
Call
(
fromStr
,
toStr
,
valueStr
,
gasStr
,
gasPriceStr
,
dataStr
string
)
(
string
,
error
)
{
statedb
:=
self
.
State
()
.
State
()
//self.chainManager.TransState()
statedb
:=
self
.
State
()
.
State
()
//self.chainManager.TransState()
msg
:=
callmsg
{
msg
:=
callmsg
{
from
:
statedb
.
GetOrNewStateObject
(
fromHex
(
fromStr
)),
from
:
statedb
.
GetOrNewStateObject
(
fromHex
(
fromStr
)),
...
@@ -310,6 +308,14 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
...
@@ -310,6 +308,14 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
value
:
ethutil
.
Big
(
valueStr
),
value
:
ethutil
.
Big
(
valueStr
),
data
:
fromHex
(
dataStr
),
data
:
fromHex
(
dataStr
),
}
}
if
msg
.
gas
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
msg
.
gas
=
defaultGas
}
if
msg
.
gasPrice
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
msg
.
gasPrice
=
defaultGasPrice
}
block
:=
self
.
chainManager
.
CurrentBlock
()
block
:=
self
.
chainManager
.
CurrentBlock
()
vmenv
:=
core
.
NewEnv
(
statedb
,
self
.
chainManager
,
msg
,
block
)
vmenv
:=
core
.
NewEnv
(
statedb
,
self
.
chainManager
,
msg
,
block
)
...
...
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