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

fix useless condition
This commit is contained in:
Undefinedor 2024-04-25 14:40:29 +08:00 committed by GitHub
parent 2f6ff492ae
commit a13b92524d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

@ -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)