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
This commit is contained in:
Felix Lange
2015-03-09 23:25:46 +01:00
84 changed files with 25638 additions and 6387 deletions

View File

@ -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