add warn for reorg

This commit is contained in:
Gerui Wang 2021-12-21 16:06:16 +08:00
parent 621555993e
commit 2969548f68

View file

@ -2116,6 +2116,7 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
}
}
)
log.Warn("Reorg", "oldBlock hash", oldBlock.Hash().Hex(), "number", oldBlock.NumberU64(), "newBlock hash", newBlock.Hash().Hex(), "number", newBlock.NumberU64())
// first reduce whoever is higher bound
if oldBlock.NumberU64() > newBlock.NumberU64() {
@ -2160,7 +2161,7 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
}
// Ensure the user sees large reorgs
if len(oldChain) > 0 && len(newChain) > 0 {
logFn := log.Debug
logFn := log.Warn
if len(oldChain) > 63 {
logFn = log.Warn
}