mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
core/blockchain: Documentation, fix minor nitpick
This commit is contained in:
parent
f9f81ffedc
commit
0cf544d8cb
1 changed files with 4 additions and 2 deletions
|
|
@ -1257,12 +1257,14 @@ func (bc *BlockChain) BadBlocks() ([]BadBlockArgs, error) {
|
|||
headers := make([]BadBlockArgs, 0, bc.badBlocks.Len())
|
||||
for _, hash := range bc.badBlocks.Keys() {
|
||||
if hdr, exist := bc.badBlocks.Peek(hash); exist {
|
||||
headers = append(headers, BadBlockArgs{hdr.(*types.Header).Hash(), hdr.(*types.Header)})
|
||||
header := hdr.(*types.Header)
|
||||
headers = append(headers, BadBlockArgs{header.Hash(), header})
|
||||
}
|
||||
}
|
||||
return headers, nil
|
||||
}
|
||||
// Adds a 'bad lock' to the LRU
|
||||
|
||||
// addBadBlock adds a bad block to the bad-block LRU cache
|
||||
func (bc *BlockChain) addBadBlock(block *types.Block) {
|
||||
bc.badBlocks.Add(block.Header().Hash(), block.Header())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue