From 62470eeaf8c6d4b360cb228b25941cef2a98e1cf Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Mon, 4 Jul 2022 10:54:15 +0200 Subject: [PATCH] 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 --- consensus/beacon/consensus.go | 1 + 1 file changed, 1 insertion(+) diff --git a/consensus/beacon/consensus.go b/consensus/beacon/consensus.go index e090a0399..2b4f6ee0d 100644 --- a/consensus/beacon/consensus.go +++ b/consensus/beacon/consensus.go @@ -178,6 +178,7 @@ func verifyTerminalPoWBlock(chain consensus.ChainHeaderReader, preHeaders []*typ if td == nil { return 0, consensus.ErrUnknownAncestor } + td = new(big.Int).Set(td) // Check that all blocks before the last one are below the TTD for i, head := range preHeaders { if td.Cmp(chain.Config().TerminalTotalDifficulty) >= 0 {