Skip to content

Commit

Permalink
add warn for reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
wgr523 committed Dec 21, 2021
1 parent 6215559 commit 2969548
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 2969548

Please sign in to comment.