From 48b7cca9f5d61696d0a49dfd2700d1477bd50ee5 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 e090a03990f6..2b4f6ee0d662 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 {