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
04a09b7e
Commit
04a09b7e
authored
Apr 28, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: set min gas price at startup
parent
32373e38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
chain_manager.go
core/chain_manager.go
+10
-10
No files found.
core/chain_manager.go
View file @
04a09b7e
...
...
@@ -92,15 +92,14 @@ type ChainManager struct {
func
NewChainManager
(
blockDb
,
stateDb
common
.
Database
,
mux
*
event
.
TypeMux
)
*
ChainManager
{
bc
:=
&
ChainManager
{
blockDb
:
blockDb
,
stateDb
:
stateDb
,
genesisBlock
:
GenesisBlock
(
stateDb
),
eventMux
:
mux
,
quit
:
make
(
chan
struct
{}),
cache
:
NewBlockCache
(
blockCacheLimit
),
currentGasLimit
:
new
(
big
.
Int
),
blockDb
:
blockDb
,
stateDb
:
stateDb
,
genesisBlock
:
GenesisBlock
(
stateDb
),
eventMux
:
mux
,
quit
:
make
(
chan
struct
{}),
cache
:
NewBlockCache
(
blockCacheLimit
),
}
bc
.
setLast
Block
()
bc
.
setLast
State
()
// Check the current state of the block hashes and make sure that we do not have any of the bad blocks in our chain
for
_
,
hash
:=
range
badHashes
{
...
...
@@ -145,7 +144,7 @@ func (bc *ChainManager) SetHead(head *types.Block) {
bc
.
transState
=
statedb
.
Copy
()
bc
.
setTotalDifficulty
(
head
.
Td
)
bc
.
insert
(
head
)
bc
.
setLast
Block
()
bc
.
setLast
State
()
}
func
(
self
*
ChainManager
)
Td
()
*
big
.
Int
{
...
...
@@ -212,7 +211,7 @@ func (self *ChainManager) setTransState(statedb *state.StateDB) {
self
.
transState
=
statedb
}
func
(
bc
*
ChainManager
)
setLast
Block
()
{
func
(
bc
*
ChainManager
)
setLast
State
()
{
data
,
_
:=
bc
.
blockDb
.
Get
([]
byte
(
"LastBlock"
))
if
len
(
data
)
!=
0
{
block
:=
bc
.
GetBlock
(
common
.
BytesToHash
(
data
))
...
...
@@ -224,6 +223,7 @@ func (bc *ChainManager) setLastBlock() {
}
else
{
bc
.
Reset
()
}
bc
.
currentGasLimit
=
CalcGasLimit
(
bc
.
currentBlock
)
if
glog
.
V
(
logger
.
Info
)
{
glog
.
Infof
(
"Last block (#%v) %x TD=%v
\n
"
,
bc
.
currentBlock
.
Number
(),
bc
.
currentBlock
.
Hash
(),
bc
.
td
)
...
...
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