Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
whqwjb
go-ethereum
提交
c01d4c2f
G
go-ethereum
项目概览
whqwjb
/
go-ethereum
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
go-ethereum
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c01d4c2f
编写于
3月 11, 2015
作者:
O
obscuren
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Lowered default gas price and increased default gas limit
上级
2da7af4b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
10 deletion
+17
-10
core/state_transition.go
core/state_transition.go
+2
-0
rpc/api.go
rpc/api.go
+2
-3
xeth/xeth.go
xeth/xeth.go
+13
-7
未找到文件。
core/state_transition.go
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录