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
07fe00c4
Commit
07fe00c4
authored
May 21, 2014
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
Changed numbers
parent
cbf221f6
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
ethchain/block_chain.go
+6
-6
6 additions, 6 deletions
ethchain/block_chain.go
with
6 additions
and
6 deletions
ethchain/block_chain.go
+
6
−
6
View file @
07fe00c4
...
...
@@ -190,8 +190,8 @@ func (bc *BlockChain) ResetTillBlockHash(hash []byte) error {
returnTo
=
bc
.
GetBlock
(
hash
)
bc
.
CurrentBlock
=
returnTo
bc
.
LastBlockHash
=
returnTo
.
Hash
()
info
:=
bc
.
BlockInfo
(
returnTo
)
bc
.
LastBlockNumber
=
inf
o
.
Number
//
info := bc.BlockInfo(returnTo)
bc
.
LastBlockNumber
=
returnT
o
.
Number
.
Uint64
()
}
// XXX Why are we resetting? This is the block chain, it has nothing to do with states
...
...
@@ -228,9 +228,9 @@ func (bc *BlockChain) GetChainFromHash(hash []byte, max uint64) []interface{} {
// Get the current hash to start with
currentHash
:=
bc
.
CurrentBlock
.
Hash
()
// Get the last number on the block chain
lastNumber
:=
bc
.
BlockInfo
(
bc
.
CurrentBlock
)
.
Number
lastNumber
:=
bc
.
CurrentBlock
.
Number
.
Uint64
()
// Get the parents number
parentNumber
:=
bc
.
Block
InfoByHash
(
hash
)
.
Number
parentNumber
:=
bc
.
Get
Block
(
hash
)
.
Number
.
Uint64
()
// Get the min amount. We might not have max amount of blocks
count
:=
uint64
(
math
.
Min
(
float64
(
lastNumber
-
parentNumber
),
float64
(
max
)))
startNumber
:=
parentNumber
+
count
...
...
@@ -291,10 +291,10 @@ func (bc *BlockChain) setLastBlock() {
data
,
_
:=
ethutil
.
Config
.
Db
.
Get
([]
byte
(
"LastBlock"
))
if
len
(
data
)
!=
0
{
block
:=
NewBlockFromBytes
(
data
)
info
:=
bc
.
BlockInfo
(
block
)
//
info := bc.BlockInfo(block)
bc
.
CurrentBlock
=
block
bc
.
LastBlockHash
=
block
.
Hash
()
bc
.
LastBlockNumber
=
info
.
Number
bc
.
LastBlockNumber
=
block
.
Number
.
Uint64
()
ethutil
.
Config
.
Log
.
Infof
(
"[CHAIN] Last known block height #%d
\n
"
,
bc
.
LastBlockNumber
)
}
else
{
...
...
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