mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/blockchain: minor clarity change
This commit is contained in:
parent
2d64d3389f
commit
e6eb32f904
1 changed files with 3 additions and 2 deletions
|
|
@ -1319,11 +1319,12 @@ func (bc *BlockChain) insertSidechain(block *types.Block, it *insertIterator) (i
|
||||||
for ; block != nil && (err == consensus.ErrPrunedAncestor); block, err = it.next() {
|
for ; block != nil && (err == consensus.ErrPrunedAncestor); block, err = it.next() {
|
||||||
// Check the canonical state root for that number
|
// Check the canonical state root for that number
|
||||||
if number := block.NumberU64(); current.NumberU64() >= number {
|
if number := block.NumberU64(); current.NumberU64() >= number {
|
||||||
if canonical := bc.GetBlockByNumber(number); canonical != nil && canonical.Hash() == block.Hash() {
|
canonical := bc.GetBlockByNumber(number)
|
||||||
|
if canonical != nil && canonical.Hash() == block.Hash() {
|
||||||
// Not a sidechain block, this is a re-import of a canon block which has it's state pruned
|
// Not a sidechain block, this is a re-import of a canon block which has it's state pruned
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if canonical := bc.GetBlockByNumber(number); canonical != nil && canonical.Root() == block.Root() {
|
if canonical != nil && canonical.Root() == block.Root() {
|
||||||
// This is most likely a shadow-state attack. When a fork is imported into the
|
// This is most likely a shadow-state attack. When a fork is imported into the
|
||||||
// database, and it eventually reaches a block height which is not pruned, we
|
// database, and it eventually reaches a block height which is not pruned, we
|
||||||
// just found that the state already exist! This means that the sidechain block
|
// just found that the state already exist! This means that the sidechain block
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue