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
6d41402d
Commit
6d41402d
authored
Mar 24, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backend no longer needed to resolve import cycle
parent
9de1ad65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
30 deletions
+4
-30
xeth.go
xeth/xeth.go
+4
-30
No files found.
xeth/xeth.go
View file @
6d41402d
...
...
@@ -15,12 +15,10 @@ import (
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/e
vent
"
"github.com/ethereum/go-ethereum/e
th
"
"github.com/ethereum/go-ethereum/event/filter"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/whisper"
)
var
(
...
...
@@ -30,30 +28,6 @@ var (
defaultGas
=
big
.
NewInt
(
90000
)
//500000
)
// to resolve the import cycle
type
Backend
interface
{
BlockProcessor
()
*
core
.
BlockProcessor
ChainManager
()
*
core
.
ChainManager
AccountManager
()
*
accounts
.
Manager
TxPool
()
*
core
.
TxPool
PeerCount
()
int
IsListening
()
bool
Peers
()
[]
*
p2p
.
Peer
BlockDb
()
common
.
Database
StateDb
()
common
.
Database
ExtraDb
()
common
.
Database
EventMux
()
*
event
.
TypeMux
Whisper
()
*
whisper
.
Whisper
Miner
()
*
miner
.
Miner
IsMining
()
bool
StartMining
()
error
StopMining
()
Version
()
string
ProtocolVersion
()
int
NetworkId
()
int
}
// Frontend should be implemented by users of XEth. Its methods are
// called whenever XEth makes a decision that requires user input.
type
Frontend
interface
{
...
...
@@ -82,7 +56,7 @@ func (dummyFrontend) UnlockAccount([]byte) bool { return false
func
(
dummyFrontend
)
ConfirmTransaction
(
*
types
.
Transaction
)
bool
{
return
true
}
type
XEth
struct
{
eth
Backend
eth
*
eth
.
Ethereum
blockProcessor
*
core
.
BlockProcessor
chainManager
*
core
.
ChainManager
accountManager
*
accounts
.
Manager
...
...
@@ -110,7 +84,7 @@ type XEth struct {
// New creates an XEth that uses the given frontend.
// If a nil Frontend is provided, a default frontend which
// confirms all transactions will be used.
func
New
(
eth
Backend
,
frontend
Frontend
)
*
XEth
{
func
New
(
eth
*
eth
.
Ethereum
,
frontend
Frontend
)
*
XEth
{
xeth
:=
&
XEth
{
eth
:
eth
,
blockProcessor
:
eth
.
BlockProcessor
(),
...
...
@@ -195,7 +169,7 @@ func (self *XEth) AtStateNum(num int64) *XEth {
return
self
.
WithState
(
st
)
}
func
(
self
*
XEth
)
Backend
()
Backend
{
return
self
.
eth
}
func
(
self
*
XEth
)
Backend
()
*
eth
.
Ethereum
{
return
self
.
eth
}
func
(
self
*
XEth
)
WithState
(
statedb
*
state
.
StateDB
)
*
XEth
{
xeth
:=
&
XEth
{
eth
:
self
.
eth
,
...
...
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