diff options
author | zelig <viktor.tron@gmail.com> | 2014-06-30 01:30:05 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2014-06-30 01:30:05 +0800 |
commit | dabaa4cce01586fd8b1b9314073a1d26f35355c8 (patch) | |
tree | fff48b2c62a1d717a7d95ffb99e9eb1d99dbf7bb /ethereum.go | |
parent | 707d413761927f5ad95298e666e297b820ad0901 (diff) | |
download | go-tangerine-dabaa4cce01586fd8b1b9314073a1d26f35355c8.tar.gz go-tangerine-dabaa4cce01586fd8b1b9314073a1d26f35355c8.tar.zst go-tangerine-dabaa4cce01586fd8b1b9314073a1d26f35355c8.zip |
change all modified calls to ethtrie, ethutil and ethcrypto functions
Diffstat (limited to 'ethereum.go')
-rw-r--r-- | ethereum.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ethereum.go b/ethereum.go index a3df23e92..b78b0658f 100644 --- a/ethereum.go +++ b/ethereum.go @@ -4,7 +4,7 @@ import ( "container/list" "fmt" "github.com/ethereum/eth-go/ethchain" - "github.com/ethereum/eth-go/ethdb" + "github.com/ethereum/eth-go/ethcrypto" "github.com/ethereum/eth-go/ethlog" "github.com/ethereum/eth-go/ethrpc" "github.com/ethereum/eth-go/ethutil" @@ -74,16 +74,15 @@ type Ethereum struct { reactor *ethutil.ReactorEngine RpcServer *ethrpc.JsonRpcServer + + keyManager *ethcrypto.KeyManager } -func New(caps Caps, usePnp bool) (*Ethereum, error) { - db, err := ethdb.NewLDBDatabase("database") - //db, err := ethdb.NewMemDatabase() - if err != nil { - return nil, err - } +func New(db ethutil.Database, keyManager *ethcrypto.KeyManager, caps Caps, usePnp bool) (*Ethereum, error) { + var err error var nat NAT + if usePnp { nat, err = Discover() if err != nil { @@ -102,6 +101,7 @@ func New(caps Caps, usePnp bool) (*Ethereum, error) { Nonce: nonce, serverCaps: caps, nat: nat, + keyManager: keyManager, } ethereum.reactor = ethutil.NewReactorEngine() @@ -119,6 +119,10 @@ func (s *Ethereum) Reactor() *ethutil.ReactorEngine { return s.reactor } +func (s *Ethereum) KeyManager() *ethcrypto.KeyManager { + return s.keyManager +} + func (s *Ethereum) BlockChain() *ethchain.BlockChain { return s.blockChain } |