Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
84d11c19
Commit
84d11c19
authored
Jun 14, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth: remove dapp database remains
parent
312263c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
25 deletions
+6
-25
types.go
core/types.go
+0
-1
backend.go
eth/backend.go
+6
-22
database.go
ethdb/database.go
+0
-2
No files found.
core/types.go
View file @
84d11c19
...
...
@@ -73,6 +73,5 @@ type Backend interface {
BlockChain
()
*
BlockChain
TxPool
()
*
TxPool
ChainDb
()
ethdb
.
Database
DappDb
()
ethdb
.
Database
EventMux
()
*
event
.
TypeMux
}
eth/backend.go
View file @
84d11c19
...
...
@@ -115,7 +115,6 @@ type Ethereum struct {
protocolManager
*
ProtocolManager
// DB interfaces
chainDb
ethdb
.
Database
// Block chain database
dappDb
ethdb
.
Database
// Dapp database
eventMux
*
event
.
TypeMux
pow
*
ethash
.
Ethash
...
...
@@ -142,7 +141,7 @@ type Ethereum struct {
// New creates a new Ethereum object (including the
// initialisation of the common Ethereum object)
func
New
(
ctx
*
node
.
ServiceContext
,
config
*
Config
)
(
*
Ethereum
,
error
)
{
chainDb
,
dappDb
,
err
:=
CreateDBs
(
ctx
,
config
)
chainDb
,
err
:=
createDB
(
ctx
,
config
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -157,7 +156,6 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
eth
:=
&
Ethereum
{
chainDb
:
chainDb
,
dappDb
:
dappDb
,
eventMux
:
ctx
.
EventMux
,
accountManager
:
ctx
.
AccountManager
,
pow
:
pow
,
...
...
@@ -243,25 +241,13 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
return
eth
,
nil
}
// CreateDBs creates the chain and dapp databases for an Ethereum service
func
CreateDBs
(
ctx
*
node
.
ServiceContext
,
config
*
Config
)
(
chainDb
,
dappDb
ethdb
.
Database
,
err
error
)
{
// Open the chain database and perform any upgrades needed
chainDb
,
err
=
ctx
.
OpenDatabase
(
"chaindata"
,
config
.
DatabaseCache
,
config
.
DatabaseHandles
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
if
db
,
ok
:=
chainDb
.
(
*
ethdb
.
LDBDatabase
);
ok
{
// createDB creates the chain database.
func
createDB
(
ctx
*
node
.
ServiceContext
,
config
*
Config
)
(
ethdb
.
Database
,
error
)
{
db
,
err
:=
ctx
.
OpenDatabase
(
"chaindata"
,
config
.
DatabaseCache
,
config
.
DatabaseHandles
)
if
db
,
ok
:=
db
.
(
*
ethdb
.
LDBDatabase
);
ok
{
db
.
Meter
(
"eth/db/chaindata/"
)
}
dappDb
,
err
=
ctx
.
OpenDatabase
(
"dapp"
,
config
.
DatabaseCache
,
config
.
DatabaseHandles
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
if
db
,
ok
:=
dappDb
.
(
*
ethdb
.
LDBDatabase
);
ok
{
db
.
Meter
(
"eth/db/dapp/"
)
}
return
return
db
,
err
}
// SetupGenesisBlock initializes the genesis block for an Ethereum service
...
...
@@ -389,7 +375,6 @@ func (s *Ethereum) TxPool() *core.TxPool { return s.txPool }
func
(
s
*
Ethereum
)
EventMux
()
*
event
.
TypeMux
{
return
s
.
eventMux
}
func
(
s
*
Ethereum
)
Pow
()
*
ethash
.
Ethash
{
return
s
.
pow
}
func
(
s
*
Ethereum
)
ChainDb
()
ethdb
.
Database
{
return
s
.
chainDb
}
func
(
s
*
Ethereum
)
DappDb
()
ethdb
.
Database
{
return
s
.
dappDb
}
func
(
s
*
Ethereum
)
IsListening
()
bool
{
return
true
}
// Always listening
func
(
s
*
Ethereum
)
EthVersion
()
int
{
return
int
(
s
.
protocolManager
.
SubProtocols
[
0
]
.
Version
)
}
func
(
s
*
Ethereum
)
NetVersion
()
int
{
return
s
.
netVersionId
}
...
...
@@ -427,7 +412,6 @@ func (s *Ethereum) Stop() error {
s
.
StopAutoDAG
()
s
.
chainDb
.
Close
()
s
.
dappDb
.
Close
()
close
(
s
.
shutdownChan
)
return
nil
...
...
ethdb/database.go
View file @
84d11c19
...
...
@@ -39,14 +39,12 @@ var OpenFileLimit = 64
// cacheRatio specifies how the total allotted cache is distributed between the
// various system databases.
var
cacheRatio
=
map
[
string
]
float64
{
"dapp"
:
0.0
,
"chaindata"
:
1.0
,
}
// handleRatio specifies how the total allotted file descriptors is distributed
// between the various system databases.
var
handleRatio
=
map
[
string
]
float64
{
"dapp"
:
0.0
,
"chaindata"
:
1.0
,
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment