Skip to content

Commit

Permalink
remove force reorg per 199 block.
Browse files Browse the repository at this point in the history
reorg should only happend at extend td bigger than local.
  • Loading branch information
rjgeek committed Jul 2, 2020
1 parent 4771a23 commit 903ab9c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,10 +857,11 @@ func (bc *BlockChain) WriteBlockAndState(block *types.Block, receipts []*types.R

var breorg bool
breorg = false
if block.Number().Uint64()%consensus.HpbNodeCheckpointInterval == 199 {
breorg = true
log.Warn("WriteBlockAndState breorg is true", "block number", block.Number())
}
//if block.Number().Uint64()%consensus.HpbNodeCheckpointInterval == 199 {
// breorg = true
// log.Warn("WriteBlockAndState breorg is true", "block number", block.Number())
//}

// If the total difficulty is higher than our known, add it to the canonical chain
// Second clause in the if statement reduces the vulnerability to selfish mining.
// Please refer to http://www.cs.cornell.edu/~ie53/publications/btcProcFC.pdf
Expand Down

0 comments on commit 903ab9c

Please sign in to comment.