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
2f20fd31
Unverified
Commit
2f20fd31
authored
Feb 21, 2023
by
Péter Szilágyi
Committed by
GitHub
Feb 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/rawdb: expose chain freezer constructor without internals (#26748)
parent
6d2d1261
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
chain_freezer.go
core/rawdb/chain_freezer.go
+2
-2
database.go
core/rawdb/database.go
+1
-1
freezer.go
core/rawdb/freezer.go
+6
-0
No files found.
core/rawdb/chain_freezer.go
View file @
2f20fd31
...
...
@@ -55,8 +55,8 @@ type chainFreezer struct {
}
// newChainFreezer initializes the freezer for ancient chain data.
func
newChainFreezer
(
datadir
string
,
namespace
string
,
readonly
bool
,
maxTableSize
uint32
,
tables
map
[
string
]
bool
)
(
*
chainFreezer
,
error
)
{
freezer
,
err
:=
New
Freezer
(
datadir
,
namespace
,
readonly
,
maxTableSize
,
tables
)
func
newChainFreezer
(
datadir
string
,
namespace
string
,
readonly
bool
)
(
*
chainFreezer
,
error
)
{
freezer
,
err
:=
New
ChainFreezer
(
datadir
,
namespace
,
readonly
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
core/rawdb/database.go
View file @
2f20fd31
...
...
@@ -200,7 +200,7 @@ func resolveChainFreezerDir(ancient string) string {
// where the chain freezer can be opened.
func
NewDatabaseWithFreezer
(
db
ethdb
.
KeyValueStore
,
ancient
string
,
namespace
string
,
readonly
bool
)
(
ethdb
.
Database
,
error
)
{
// Create the idle freezer instance
frdb
,
err
:=
newChainFreezer
(
resolveChainFreezerDir
(
ancient
),
namespace
,
readonly
,
freezerTableSize
,
chainFreezerNoSnappy
)
frdb
,
err
:=
newChainFreezer
(
resolveChainFreezerDir
(
ancient
),
namespace
,
readonly
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
core/rawdb/freezer.go
View file @
2f20fd31
...
...
@@ -79,6 +79,12 @@ type Freezer struct {
closeOnce
sync
.
Once
}
// NewChainFreezer is a small utility method around NewFreezer that sets the
// default parameters for the chain storage.
func
NewChainFreezer
(
datadir
string
,
namespace
string
,
readonly
bool
)
(
*
Freezer
,
error
)
{
return
NewFreezer
(
datadir
,
namespace
,
readonly
,
freezerTableSize
,
chainFreezerNoSnappy
)
}
// NewFreezer creates a freezer instance for maintaining immutable ordered
// data according to the given parameters.
//
...
...
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