mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-05 14:38:42 +00:00
eth/protocols/eth: only track after send is okay (#35086)
This commit is contained in:
parent
ff45d1dd7b
commit
5016e54406
1 changed files with 6 additions and 5 deletions
|
|
@ -209,14 +209,15 @@ func (p *Peer) AsyncSendPooledTransactionHashes(hashes []common.Hash) {
|
||||||
|
|
||||||
// ReplyPooledTransactionsRLP is the response to RequestTxs.
|
// ReplyPooledTransactionsRLP is the response to RequestTxs.
|
||||||
func (p *Peer) ReplyPooledTransactionsRLP(id uint64, hashes []common.Hash, txs []rlp.RawValue) error {
|
func (p *Peer) ReplyPooledTransactionsRLP(id uint64, hashes []common.Hash, txs []rlp.RawValue) error {
|
||||||
// Mark all the transactions as known, but ensure we don't overflow our limits
|
|
||||||
p.knownTxs.Add(hashes...)
|
|
||||||
|
|
||||||
// Not packed into PooledTransactionsResponse to avoid RLP decoding
|
// Not packed into PooledTransactionsResponse to avoid RLP decoding
|
||||||
return p2p.Send(p.rw, PooledTransactionsMsg, &PooledTransactionsRLPPacket{
|
if err := p2p.Send(p.rw, PooledTransactionsMsg, &PooledTransactionsRLPPacket{
|
||||||
RequestId: id,
|
RequestId: id,
|
||||||
PooledTransactionsRLPResponse: txs,
|
PooledTransactionsRLPResponse: txs,
|
||||||
})
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
p.knownTxs.Add(hashes...)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReplyBlockHeadersRLP is the response to GetBlockHeaders.
|
// ReplyBlockHeadersRLP is the response to GetBlockHeaders.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue