mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
eth/protocols/eth: fix return early when and skips tracker.Fulfil
This commit is contained in:
parent
934a0091fa
commit
0536e03e62
1 changed files with 5 additions and 6 deletions
|
|
@ -632,12 +632,7 @@ func handleTransactions(backend Backend, msg Decoder, peer *Peer) error {
|
|||
}
|
||||
|
||||
func handlePooledTransactions(backend Backend, msg Decoder, peer *Peer) error {
|
||||
// Transactions arrived, make sure we have a valid and fresh chain to handle them
|
||||
if !backend.AcceptTxs() {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Check against request and decode.
|
||||
// always accept the response, even if we don't have a valid chain, to allow the peer to update its tracker and avoid timeouts
|
||||
var resp PooledTransactionsPacket
|
||||
if err := msg.Decode(&resp); err != nil {
|
||||
return err
|
||||
|
|
@ -651,6 +646,10 @@ func handlePooledTransactions(backend Backend, msg Decoder, peer *Peer) error {
|
|||
return fmt.Errorf("PooledTransactions: %w", err)
|
||||
}
|
||||
|
||||
if !backend.AcceptTxs() {
|
||||
return nil
|
||||
}
|
||||
|
||||
return backend.Handle(peer, &resp)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue