add ClientIdentity() ethwire.ClientIdentity to Ethereum
This commit is contained in:
parent
c64629964f
commit
c833c3fec8
25
ethereum.go
25
ethereum.go
@ -76,9 +76,11 @@ type Ethereum struct {
|
|||||||
RpcServer *ethrpc.JsonRpcServer
|
RpcServer *ethrpc.JsonRpcServer
|
||||||
|
|
||||||
keyManager *ethcrypto.KeyManager
|
keyManager *ethcrypto.KeyManager
|
||||||
|
|
||||||
|
clientIdentity ethwire.ClientIdentity
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(db ethutil.Database, keyManager *ethcrypto.KeyManager, caps Caps, usePnp bool) (*Ethereum, error) {
|
func New(db ethutil.Database, clientIdentity ethwire.ClientIdentity, keyManager *ethcrypto.KeyManager, caps Caps, usePnp bool) (*Ethereum, error) {
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
var nat NAT
|
var nat NAT
|
||||||
@ -94,14 +96,15 @@ func New(db ethutil.Database, keyManager *ethcrypto.KeyManager, caps Caps, usePn
|
|||||||
|
|
||||||
nonce, _ := ethutil.RandomUint64()
|
nonce, _ := ethutil.RandomUint64()
|
||||||
ethereum := &Ethereum{
|
ethereum := &Ethereum{
|
||||||
shutdownChan: make(chan bool),
|
shutdownChan: make(chan bool),
|
||||||
quit: make(chan bool),
|
quit: make(chan bool),
|
||||||
db: db,
|
db: db,
|
||||||
peers: list.New(),
|
peers: list.New(),
|
||||||
Nonce: nonce,
|
Nonce: nonce,
|
||||||
serverCaps: caps,
|
serverCaps: caps,
|
||||||
nat: nat,
|
nat: nat,
|
||||||
keyManager: keyManager,
|
keyManager: keyManager,
|
||||||
|
clientIdentity: clientIdentity,
|
||||||
}
|
}
|
||||||
ethereum.reactor = ethutil.NewReactorEngine()
|
ethereum.reactor = ethutil.NewReactorEngine()
|
||||||
|
|
||||||
@ -123,6 +126,10 @@ func (s *Ethereum) KeyManager() *ethcrypto.KeyManager {
|
|||||||
return s.keyManager
|
return s.keyManager
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Ethereum) ClientIdentity() ethwire.ClientIdentity {
|
||||||
|
return s.clientIdentity
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Ethereum) BlockChain() *ethchain.BlockChain {
|
func (s *Ethereum) BlockChain() *ethchain.BlockChain {
|
||||||
return s.blockChain
|
return s.blockChain
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user