diff --git a/eth/protocols/eth/peer.go b/eth/protocols/eth/peer.go index 583b2dce38..61debbeadb 100644 --- a/eth/protocols/eth/peer.go +++ b/eth/protocols/eth/peer.go @@ -192,12 +192,18 @@ func (p *Peer) AsyncSendTransactions(hashes []common.Hash) { // directly as the queueing (memory) and transmission (bandwidth) costs should // not be managed directly. func (p *Peer) sendPooledTransactionHashes(hashes []common.Hash, types []byte, sizes []uint32, cells types.CustodyBitmap) error { + var err error + if p.version >= ETH72 { + err = p2p.Send(p.rw, NewPooledTransactionHashesMsg, NewPooledTransactionHashesPacket72{Types: types, Sizes: sizes, Hashes: hashes, Mask: cells}) + } else { + err = p2p.Send(p.rw, NewPooledTransactionHashesMsg, NewPooledTransactionHashesPacket71{Types: types, Sizes: sizes, Hashes: hashes}) + } + if err != nil { + return err + } // Mark all the transactions as known, but ensure we don't overflow our limits p.knownTxs.Add(hashes...) - if p.version >= ETH72 { - return p2p.Send(p.rw, NewPooledTransactionHashesMsg, NewPooledTransactionHashesPacket72{Types: types, Sizes: sizes, Hashes: hashes, Mask: cells}) - } - return p2p.Send(p.rw, NewPooledTransactionHashesMsg, NewPooledTransactionHashesPacket71{Types: types, Sizes: sizes, Hashes: hashes}) + return nil } // AsyncSendPooledTransactionHashes queues a list of transactions hashes to eventually