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
a38e1a9c
Unverified
Commit
a38e1a9c
authored
Mar 03, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: reorg logs crashed, add a check for corner cases
parent
faf71363
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
blockchain.go
core/blockchain.go
+9
-6
No files found.
core/blockchain.go
View file @
a38e1a9c
...
...
@@ -1145,13 +1145,16 @@ func (self *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
}
}
// Ensure the user sees large reorgs
if
len
(
oldChain
)
>
0
&&
len
(
newChain
)
>
0
{
logFn
:=
log
.
Debug
if
len
(
oldChain
)
>
63
{
logFn
=
log
.
Warn
}
logFn
(
"Chain split detected"
,
"number"
,
commonBlock
.
Number
(),
"hash"
,
commonBlock
.
Hash
(),
"drop"
,
len
(
oldChain
),
"dropfrom"
,
oldChain
[
0
]
.
Hash
(),
"add"
,
len
(
newChain
),
"addfrom"
,
newChain
[
0
]
.
Hash
())
}
else
{
log
.
Error
(
"Impossible reorg, please file an issue"
,
"oldnum"
,
oldBlock
.
Number
(),
"oldhash"
,
oldBlock
.
Hash
(),
"newnum"
,
newBlock
.
Number
(),
"newhash"
,
newBlock
.
Hash
())
}
var
addedTxs
types
.
Transactions
// insert blocks. Order does not matter. Last block will be written in ImportChain itself which creates the new head properly
for
_
,
block
:=
range
newChain
{
...
...
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