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
e349fac9
Commit
e349fac9
authored
Jun 27, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fixed tests
parent
aba901e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
2 deletions
+2
-2
chain_makers_test.go
core/chain_makers_test.go
+1
-1
chain_manager.go
core/chain_manager.go
+1
-0
chain_manager_test.go
core/chain_manager_test.go
+0
-1
No files found.
core/chain_makers_test.go
View file @
e349fac9
...
...
@@ -60,7 +60,7 @@ func ExampleGenerateChain() {
evmux
:=
&
event
.
TypeMux
{}
chainman
,
_
:=
NewChainManager
(
genesis
,
db
,
db
,
FakePow
{},
evmux
)
chainman
.
SetProcessor
(
NewBlockProcessor
(
db
,
db
,
FakePow
{},
chainman
,
evmux
))
if
i
,
err
:=
chainman
.
InsertChain
(
chain
[
1
:
]
);
err
!=
nil
{
if
i
,
err
:=
chainman
.
InsertChain
(
chain
);
err
!=
nil
{
fmt
.
Printf
(
"insert error (block %d): %v
\n
"
,
i
,
err
)
return
}
...
...
core/chain_manager.go
View file @
e349fac9
...
...
@@ -264,6 +264,7 @@ func (bc *ChainManager) setLastState() {
func
(
bc
*
ChainManager
)
makeCache
()
{
bc
.
cache
,
_
=
lru
.
New
(
blockCacheLimit
)
// load in last `blockCacheLimit` - 1 blocks. Last block is the current.
bc
.
cache
.
Add
(
bc
.
genesisBlock
.
Hash
(),
bc
.
genesisBlock
)
for
_
,
block
:=
range
bc
.
GetBlocksFromHash
(
bc
.
currentBlock
.
Hash
(),
blockCacheLimit
)
{
bc
.
cache
.
Add
(
block
.
Hash
(),
block
)
}
...
...
core/chain_manager_test.go
View file @
e349fac9
...
...
@@ -63,7 +63,6 @@ func testFork(t *testing.T, bman *BlockProcessor, i, N int, f func(td1, td2 *big
if
bi1
!=
bi2
{
t
.
Fatal
(
"chains do not have the same hash at height"
,
i
)
}
bman2
.
bc
.
SetProcessor
(
bman2
)
// extend the fork
...
...
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