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
754160af
Commit
754160af
authored
Mar 20, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move gas defaults to XEth
parent
3cea7d87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
api.go
rpc/api.go
+3
-10
xeth.go
xeth/xeth.go
+5
-5
No files found.
rpc/api.go
View file @
754160af
...
...
@@ -2,7 +2,6 @@ package rpc
import
(
"encoding/json"
"fmt"
"math/big"
"path"
"strings"
...
...
@@ -15,11 +14,6 @@ import (
"github.com/ethereum/go-ethereum/xeth"
)
var
(
defaultGasPrice
=
big
.
NewInt
(
150000000000
)
defaultGas
=
big
.
NewInt
(
500000
)
)
type
EthereumApi
struct
{
eth
*
xeth
.
XEth
xethMu
sync
.
RWMutex
...
...
@@ -109,16 +103,15 @@ func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) (err error)
// TODO: align default values to have the same type, e.g. not depend on
// common.Value conversions later on
if
args
.
Gas
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
args
.
Gas
=
defaultGas
args
.
Gas
=
p
.
xeth
()
.
DefaultGas
()
}
if
args
.
GasPrice
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
args
.
GasPrice
=
defaultGasPrice
args
.
GasPrice
=
p
.
xeth
()
.
DefaultGasPrice
()
}
*
reply
,
err
=
p
.
xeth
()
.
Transact
(
args
.
From
,
args
.
To
,
args
.
Value
.
String
(),
args
.
Gas
.
String
(),
args
.
GasPrice
.
String
(),
args
.
Data
)
if
err
!=
nil
{
fmt
.
Println
(
"err:"
,
err
)
return
err
}
...
...
@@ -199,7 +192,7 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
case
"eth_mining"
:
*
reply
=
p
.
xeth
()
.
IsMining
()
case
"eth_gasPrice"
:
*
reply
=
common
.
ToHex
(
defaultGasPrice
.
Bytes
())
*
reply
=
common
.
ToHex
(
p
.
xeth
()
.
DefaultGas
()
.
Bytes
())
case
"eth_accounts"
:
*
reply
=
p
.
xeth
()
.
Accounts
()
case
"eth_blockNumber"
:
...
...
xeth/xeth.go
View file @
754160af
...
...
@@ -25,6 +25,8 @@ import (
var
(
pipelogger
=
logger
.
NewLogger
(
"XETH"
)
filterTickerTime
=
5
*
time
.
Minute
defaultGasPrice
=
big
.
NewInt
(
10000000000000
)
//150000000000
defaultGas
=
big
.
NewInt
(
90000
)
//500000
)
// to resolve the import cycle
...
...
@@ -154,6 +156,9 @@ func (self *XEth) stop() {
close
(
self
.
quit
)
}
func
(
self
*
XEth
)
DefaultGas
()
*
big
.
Int
{
return
defaultGas
}
func
(
self
*
XEth
)
DefaultGasPrice
()
*
big
.
Int
{
return
defaultGasPrice
}
func
(
self
*
XEth
)
AtStateNum
(
num
int64
)
*
XEth
{
chain
:=
self
.
Backend
()
.
ChainManager
()
var
block
*
types
.
Block
...
...
@@ -486,11 +491,6 @@ func (self *XEth) PushTx(encodedTx string) (string, error) {
return
common
.
ToHex
(
tx
.
Hash
()),
nil
}
var
(
defaultGasPrice
=
big
.
NewInt
(
10000000000000
)
defaultGas
=
big
.
NewInt
(
90000
)
)
func
(
self
*
XEth
)
Call
(
fromStr
,
toStr
,
valueStr
,
gasStr
,
gasPriceStr
,
dataStr
string
)
(
string
,
error
)
{
statedb
:=
self
.
State
()
.
State
()
//self.chainManager.TransState()
msg
:=
callmsg
{
...
...
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