all: change blacklist terms

This commit is contained in:
baptiste-b-pegasys
2021-07-29 10:17:40 +02:00
committed by GitHub
parent 56e9001a1a
commit 523866c2cc
8 changed files with 17 additions and 17 deletions

View File

@ -1785,8 +1785,8 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
}
// If the header is a banned one, straight out abort
if BadHashes[block.Hash()] {
bc.reportBlock(block, nil, ErrBlacklistedHash)
return it.index, ErrBlacklistedHash
bc.reportBlock(block, nil, ErrBannedHash)
return it.index, ErrBannedHash
}
// If the block is known (in the middle of the chain), it's a special case for
// Clique blocks where they can share state among each other, so importing an

View File

@ -473,8 +473,8 @@ func testBadHashes(t *testing.T, full bool) {
_, err = blockchain.InsertHeaderChain(headers, 1)
}
if !errors.Is(err, ErrBlacklistedHash) {
t.Errorf("error mismatch: have: %v, want: %v", err, ErrBlacklistedHash)
if !errors.Is(err, ErrBannedHash) {
t.Errorf("error mismatch: have: %v, want: %v", err, ErrBannedHash)
}
}

View File

@ -26,8 +26,8 @@ var (
// ErrKnownBlock is returned when a block to import is already known locally.
ErrKnownBlock = errors.New("block already known")
// ErrBlacklistedHash is returned if a block to import is on the blacklist.
ErrBlacklistedHash = errors.New("blacklisted hash")
// ErrBannedHash is returned if a block to import is on the banned list.
ErrBannedHash = errors.New("banned hash")
// ErrNoGenesis is returned when there is no Genesis Block.
ErrNoGenesis = errors.New("genesis not found in chain")

View File

@ -315,11 +315,11 @@ func (hc *HeaderChain) ValidateHeaderChain(chain []*types.Header, checkFreq int)
}
// If the header is a banned one, straight out abort
if BadHashes[chain[i].ParentHash] {
return i - 1, ErrBlacklistedHash
return i - 1, ErrBannedHash
}
// If it's the last header in the cunk, we need to check it too
if i == len(chain)-1 && BadHashes[chain[i].Hash()] {
return i, ErrBlacklistedHash
return i, ErrBannedHash
}
}