aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-29 23:52:00 +0800
committerobscuren <geffobscura@gmail.com>2015-01-29 23:52:00 +0800
commit6488a392a347d0d47212fdc78386e3e0e5841d7d (patch)
treeed95cdf67028b2b60ddc7850728abe9a391796bf /xeth
parentddf17d93acf92ef18b0134f19f22220362e06bad (diff)
downloaddexon-6488a392a347d0d47212fdc78386e3e0e5841d7d.tar.gz
dexon-6488a392a347d0d47212fdc78386e3e0e5841d7d.tar.zst
dexon-6488a392a347d0d47212fdc78386e3e0e5841d7d.zip
Reimplemented message filters for rpc calls
Diffstat (limited to 'xeth')
-rw-r--r--xeth/xeth.go21
1 files changed, 15 insertions, 6 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 382a1f285..4cfa104d0 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -12,7 +12,9 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
+ "github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/state"
)
@@ -22,19 +24,22 @@ var pipelogger = logger.NewLogger("XETH")
type Backend interface {
BlockProcessor() *core.BlockProcessor
ChainManager() *core.ChainManager
- KeyManager() *crypto.KeyManager
+ TxPool() *core.TxPool
+ PeerCount() int
IsMining() bool
IsListening() bool
- PeerCount() int
+ Peers() []*p2p.Peer
+ KeyManager() *crypto.KeyManager
+ ClientIdentity() p2p.ClientIdentity
Db() ethutil.Database
- TxPool() *core.TxPool
+ EventMux() *event.TypeMux
}
type XEth struct {
eth Backend
blockProcessor *core.BlockProcessor
chainManager *core.ChainManager
- world *State
+ state *State
}
func New(eth Backend) *XEth {
@@ -43,12 +48,16 @@ func New(eth Backend) *XEth {
blockProcessor: eth.BlockProcessor(),
chainManager: eth.ChainManager(),
}
- xeth.world = NewState(xeth)
+ xeth.state = NewState(xeth)
return xeth
}
-func (self *XEth) State() *State { return self.world }
+func (self *XEth) Backend() Backend {
+ return self.eth
+}
+
+func (self *XEth) State() *State { return self.state }
func (self *XEth) BlockByHash(strHash string) *Block {
hash := fromHex(strHash)