consensus/beacon: copy td value so we can modify it (#25230)

* consensus/beacon: copy td value so we can modify it

* consensus/beacon: copy td value so we can modify it
This commit is contained in:
Marius van der Wijden 2022-07-04 10:54:15 +02:00 committed by GitHub
parent 2697e44d81
commit 62470eeaf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,6 +178,7 @@ func verifyTerminalPoWBlock(chain consensus.ChainHeaderReader, preHeaders []*typ
if td == nil { if td == nil {
return 0, consensus.ErrUnknownAncestor return 0, consensus.ErrUnknownAncestor
} }
td = new(big.Int).Set(td)
// Check that all blocks before the last one are below the TTD // Check that all blocks before the last one are below the TTD
for i, head := range preHeaders { for i, head := range preHeaders {
if td.Cmp(chain.Config().TerminalTotalDifficulty) >= 0 { if td.Cmp(chain.Config().TerminalTotalDifficulty) >= 0 {