aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethereum.go')
-rw-r--r--ethereum.go18
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
}