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
+1 -1
View File
@@ -117,7 +117,7 @@ func (h *serverHandler) handle(p *clientPeer) error {
hash = head.Hash()
number = head.Number.Uint64()
td = h.blockchain.GetTd(hash, number)
forkID = forkid.NewID(h.blockchain.Config(), h.blockchain.Genesis().Hash(), h.blockchain.CurrentBlock().NumberU64(), h.blockchain.CurrentBlock().Time())
forkID = forkid.NewID(h.blockchain.Config(), h.blockchain.Genesis().Hash(), number, head.Time)
)
if err := p.Handshake(td, hash, number, h.blockchain.Genesis().Hash(), forkID, h.forkFilter, h.server); err != nil {
p.Log().Debug("Light Ethereum handshake failed", "err", err)