eth/protocols/eth,p2p/discover: remove unnecessary checks (#29590)

fix useless condition
pull/29644/head
Undefinedor 7 months ago committed by GitHub
parent 2f6ff492ae
commit a13b92524d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      eth/protocols/eth/handlers.go
  2. 2
      p2p/discover/v4_udp.go

@ -190,7 +190,7 @@ func serviceContiguousBlockHeaderQuery(chain *core.BlockChain, query *GetBlockHe
return headers
}
{ // Last mode: deliver ancestors of H
for i := uint64(1); header != nil && i < count; i++ {
for i := uint64(1); i < count; i++ {
header = chain.GetHeaderByHash(header.ParentHash)
if header == nil {
break

@ -548,7 +548,7 @@ func (t *UDPv4) handlePacket(from *net.UDPAddr, buf []byte) error {
}
packet := t.wrapPacket(rawpacket)
fromID := fromKey.ID()
if err == nil && packet.preverify != nil {
if packet.preverify != nil {
err = packet.preverify(packet, from, fromID, fromKey)
}
t.log.Trace("<< "+packet.Name(), "id", fromID, "addr", from, "err", err)

Loading…
Cancel
Save