good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
04a09b7e
Commit
04a09b7e
authored
Apr 28, 2015
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
core: set min gas price at startup
parent
32373e38
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/chain_manager.go
+10
-10
10 additions, 10 deletions
core/chain_manager.go
with
10 additions
and
10 deletions
core/chain_manager.go
+
10
−
10
View file @
04a09b7e
...
@@ -98,9 +98,8 @@ func NewChainManager(blockDb, stateDb common.Database, mux *event.TypeMux) *Chai
...
@@ -98,9 +98,8 @@ func NewChainManager(blockDb, stateDb common.Database, mux *event.TypeMux) *Chai
eventMux
:
mux
,
eventMux
:
mux
,
quit
:
make
(
chan
struct
{}),
quit
:
make
(
chan
struct
{}),
cache
:
NewBlockCache
(
blockCacheLimit
),
cache
:
NewBlockCache
(
blockCacheLimit
),
currentGasLimit
:
new
(
big
.
Int
),
}
}
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
// 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
{
for
_
,
hash
:=
range
badHashes
{
...
@@ -145,7 +144,7 @@ func (bc *ChainManager) SetHead(head *types.Block) {
...
@@ -145,7 +144,7 @@ func (bc *ChainManager) SetHead(head *types.Block) {
bc
.
transState
=
statedb
.
Copy
()
bc
.
transState
=
statedb
.
Copy
()
bc
.
setTotalDifficulty
(
head
.
Td
)
bc
.
setTotalDifficulty
(
head
.
Td
)
bc
.
insert
(
head
)
bc
.
insert
(
head
)
bc
.
setLast
Block
()
bc
.
setLast
State
()
}
}
func
(
self
*
ChainManager
)
Td
()
*
big
.
Int
{
func
(
self
*
ChainManager
)
Td
()
*
big
.
Int
{
...
@@ -212,7 +211,7 @@ func (self *ChainManager) setTransState(statedb *state.StateDB) {
...
@@ -212,7 +211,7 @@ func (self *ChainManager) setTransState(statedb *state.StateDB) {
self
.
transState
=
statedb
self
.
transState
=
statedb
}
}
func
(
bc
*
ChainManager
)
setLast
Block
()
{
func
(
bc
*
ChainManager
)
setLast
State
()
{
data
,
_
:=
bc
.
blockDb
.
Get
([]
byte
(
"LastBlock"
))
data
,
_
:=
bc
.
blockDb
.
Get
([]
byte
(
"LastBlock"
))
if
len
(
data
)
!=
0
{
if
len
(
data
)
!=
0
{
block
:=
bc
.
GetBlock
(
common
.
BytesToHash
(
data
))
block
:=
bc
.
GetBlock
(
common
.
BytesToHash
(
data
))
...
@@ -224,6 +223,7 @@ func (bc *ChainManager) setLastBlock() {
...
@@ -224,6 +223,7 @@ func (bc *ChainManager) setLastBlock() {
}
else
{
}
else
{
bc
.
Reset
()
bc
.
Reset
()
}
}
bc
.
currentGasLimit
=
CalcGasLimit
(
bc
.
currentBlock
)
if
glog
.
V
(
logger
.
Info
)
{
if
glog
.
V
(
logger
.
Info
)
{
glog
.
Infof
(
"Last block (#%v) %x TD=%v
\n
"
,
bc
.
currentBlock
.
Number
(),
bc
.
currentBlock
.
Hash
(),
bc
.
td
)
glog
.
Infof
(
"Last block (#%v) %x TD=%v
\n
"
,
bc
.
currentBlock
.
Number
(),
bc
.
currentBlock
.
Hash
(),
bc
.
td
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment