eth, les: polish forkid a bit, fix races and transition validation

This commit is contained in:
Péter Szilágyi
2023-01-06 15:29:57 +02:00
parent d021157820
commit fcf3d00488
6 changed files with 343 additions and 361 deletions
+2 -1
View File
@@ -59,7 +59,8 @@ func StartENRUpdater(chain *core.BlockChain, ln *enode.LocalNode) {
// currentENREntry constructs an `eth` ENR entry based on the current state of the chain.
func currentENREntry(chain *core.BlockChain) *enrEntry {
head := chain.CurrentHeader()
return &enrEntry{
ForkID: forkid.NewID(chain.Config(), chain.Genesis().Hash(), chain.CurrentHeader().Number.Uint64(), chain.CurrentHeader().Time),
ForkID: forkid.NewID(chain.Config(), chain.Genesis().Hash(), head.Number.Uint64(), head.Time),
}
}