core, light: address comments

This commit is contained in:
rjl493456442 2019-11-20 16:41:43 +08:00
parent 61ba56ff73
commit 65213973cc
2 changed files with 4 additions and 4 deletions

View file

@ -408,7 +408,7 @@ func (bc *BlockChain) SetHead(head uint64) error {
rawdb.WriteHeadBlockHash(db, newHeadBlock.Hash())
// Degrade the chain markers if they are explicitly reverted.
// In thoery we should update all in-memory markers in the
// In theory we should update all in-memory markers in the
// last step, however the direction of SetHead is from high
// to low, so it's safe the update in-memory markers directly.
bc.currentBlock.Store(newHeadBlock)
@ -425,7 +425,7 @@ func (bc *BlockChain) SetHead(head uint64) error {
rawdb.WriteHeadFastBlockHash(db, newHeadFastBlock.Hash())
// Degrade the chain markers if they are explicitly reverted.
// In thoery we should update all in-memory markers in the
// In theory we should update all in-memory markers in the
// last step, however the direction of SetHead is from high
// to low, so it's safe the update in-memory markers directly.
bc.currentFastBlock.Store(newHeadFastBlock)
@ -903,7 +903,7 @@ func (bc *BlockChain) Rollback(chain []common.Hash) {
hash := chain[i]
// Degrade the chain markers if they are explicitly reverted.
// In thoery we should update all in-memory markers in the
// In theory we should update all in-memory markers in the
// last step, however the direction of rollback is from high
// to low, so it's safe the update in-memory markers directly.
currentHeader := bc.hc.CurrentHeader()

View file

@ -331,7 +331,7 @@ func (lc *LightChain) Rollback(chain []common.Hash) {
hash := chain[i]
// Degrade the chain markers if they are explicitly reverted.
// In thoery we should update all in-memory markers in the
// In theory we should update all in-memory markers in the
// last step, however the direction of rollback is from high
// to low, so it's safe the update in-memory markers directly.
if head := lc.hc.CurrentHeader(); head.Hash() == hash {