@@ -115,7 +115,6 @@ type Ethereum struct {
115
115
protocolManager * ProtocolManager
116
116
// DB interfaces
117
117
chainDb ethdb.Database // Block chain database
118
- dappDb ethdb.Database // Dapp database
119
118
120
119
eventMux * event.TypeMux
121
120
pow * ethash.Ethash
@@ -142,7 +141,7 @@ type Ethereum struct {
142
141
// New creates a new Ethereum object (including the
143
142
// initialisation of the common Ethereum object)
144
143
func New (ctx * node.ServiceContext , config * Config ) (* Ethereum , error ) {
145
- chainDb , dappDb , err := CreateDBs (ctx , config )
144
+ chainDb , err := createDB (ctx , config )
146
145
if err != nil {
147
146
return nil , err
148
147
}
@@ -157,7 +156,6 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
157
156
158
157
eth := & Ethereum {
159
158
chainDb : chainDb ,
160
- dappDb : dappDb ,
161
159
eventMux : ctx .EventMux ,
162
160
accountManager : ctx .AccountManager ,
163
161
pow : pow ,
@@ -243,25 +241,13 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
243
241
return eth , nil
244
242
}
245
243
246
- // CreateDBs creates the chain and dapp databases for an Ethereum service
247
- func CreateDBs (ctx * node.ServiceContext , config * Config ) (chainDb , dappDb ethdb.Database , err error ) {
248
- // Open the chain database and perform any upgrades needed
249
- chainDb , err = ctx .OpenDatabase ("chaindata" , config .DatabaseCache , config .DatabaseHandles )
250
- if err != nil {
251
- return nil , nil , err
252
- }
253
- if db , ok := chainDb .(* ethdb.LDBDatabase ); ok {
244
+ // createDB creates the chain database.
245
+ func createDB (ctx * node.ServiceContext , config * Config ) (ethdb.Database , error ) {
246
+ db , err := ctx .OpenDatabase ("chaindata" , config .DatabaseCache , config .DatabaseHandles )
247
+ if db , ok := db .(* ethdb.LDBDatabase ); ok {
254
248
db .Meter ("eth/db/chaindata/" )
255
249
}
256
-
257
- dappDb , err = ctx .OpenDatabase ("dapp" , config .DatabaseCache , config .DatabaseHandles )
258
- if err != nil {
259
- return nil , nil , err
260
- }
261
- if db , ok := dappDb .(* ethdb.LDBDatabase ); ok {
262
- db .Meter ("eth/db/dapp/" )
263
- }
264
- return
250
+ return db , err
265
251
}
266
252
267
253
// SetupGenesisBlock initializes the genesis block for an Ethereum service
@@ -389,7 +375,6 @@ func (s *Ethereum) TxPool() *core.TxPool { return s.txPool }
389
375
func (s * Ethereum ) EventMux () * event.TypeMux { return s .eventMux }
390
376
func (s * Ethereum ) Pow () * ethash.Ethash { return s .pow }
391
377
func (s * Ethereum ) ChainDb () ethdb.Database { return s .chainDb }
392
- func (s * Ethereum ) DappDb () ethdb.Database { return s .dappDb }
393
378
func (s * Ethereum ) IsListening () bool { return true } // Always listening
394
379
func (s * Ethereum ) EthVersion () int { return int (s .protocolManager .SubProtocols [0 ].Version ) }
395
380
func (s * Ethereum ) NetVersion () int { return s .netVersionId }
@@ -427,7 +412,6 @@ func (s *Ethereum) Stop() error {
427
412
s .StopAutoDAG ()
428
413
429
414
s .chainDb .Close ()
430
- s .dappDb .Close ()
431
415
close (s .shutdownChan )
432
416
433
417
return nil
0 commit comments