aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-10 06:25:46 +0800
committerFelix Lange <fjl@twurst.com>2015-03-10 06:25:46 +0800
commit9bf513e99305af733110cf23a0b47c8e73359010 (patch)
treef9d36e1ae1f2f7c3eb803c7499a4e85a5cdcd5bd /xeth
parentcd51860bf024d949a09b3863c88a278a386227a7 (diff)
parent676a0de58d3d7c508b0eeeff192d2095a46f7382 (diff)
downloaddexon-9bf513e99305af733110cf23a0b47c8e73359010.tar
dexon-9bf513e99305af733110cf23a0b47c8e73359010.tar.gz
dexon-9bf513e99305af733110cf23a0b47c8e73359010.tar.bz2
dexon-9bf513e99305af733110cf23a0b47c8e73359010.tar.lz
dexon-9bf513e99305af733110cf23a0b47c8e73359010.tar.xz
dexon-9bf513e99305af733110cf23a0b47c8e73359010.tar.zst
dexon-9bf513e99305af733110cf23a0b47c8e73359010.zip
Merge ethereum/poc-9 into accounts-integration
Conflicts: cmd/utils/cmd.go cmd/utils/flags.go core/manager.go eth/backend.go rpc/http/server.go xeth/xeth.go
Diffstat (limited to 'xeth')
-rw-r--r--xeth/state.go2
-rw-r--r--xeth/xeth.go18
2 files changed, 17 insertions, 3 deletions
diff --git a/xeth/state.go b/xeth/state.go
index e2562613c..0f6a042b3 100644
--- a/xeth/state.go
+++ b/xeth/state.go
@@ -26,7 +26,7 @@ func (self *State) SafeGet(addr string) *Object {
func (self *State) safeGet(addr string) *state.StateObject {
object := self.state.GetStateObject(fromHex(addr))
if object == nil {
- object = state.NewStateObject(fromHex(addr), self.xeth.eth.Db())
+ object = state.NewStateObject(fromHex(addr), self.xeth.eth.StateDb())
}
return object
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 956b8cd01..a0491506b 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -19,6 +19,7 @@ import (
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/state"
+ "github.com/ethereum/go-ethereum/ui"
"github.com/ethereum/go-ethereum/whisper"
)
@@ -33,7 +34,8 @@ type Backend interface {
PeerCount() int
IsListening() bool
Peers() []*p2p.Peer
- Db() ethutil.Database
+ BlockDb() ethutil.Database
+ StateDb() ethutil.Database
EventMux() *event.TypeMux
Whisper() *whisper.Whisper
Miner() *miner.Miner
@@ -47,9 +49,16 @@ type XEth struct {
state *State
whisper *Whisper
miner *miner.Miner
+
+ frontend ui.Interface
}
-func New(eth Backend) *XEth {
+type TmpFrontend struct{}
+
+func (TmpFrontend) UnlockAccount([]byte) bool { panic("UNLOCK ACCOUNT") }
+func (TmpFrontend) ConfirmTransaction(*types.Transaction) bool { panic("CONFIRM TRANSACTION") }
+
+func New(eth Backend, frontend ui.Interface) *XEth {
xeth := &XEth{
eth: eth,
blockProcessor: eth.BlockProcessor(),
@@ -58,6 +67,11 @@ func New(eth Backend) *XEth {
whisper: NewWhisper(eth.Whisper()),
miner: eth.Miner(),
}
+
+ if frontend == nil {
+ xeth.frontend = TmpFrontend{}
+ }
+
xeth.state = NewState(xeth, xeth.chainManager.TransState())
return xeth