fix: ensure peer exists b4 marking txs as received (#7998)

This commit is contained in:
Oliver Nordbjerg
2024-04-30 16:17:31 +02:00
committed by GitHub
parent 29e0e8150c
commit b99d367c1a

View File

@ -945,14 +945,13 @@ where
return
}
let Some(peer) = self.peers.get_mut(&peer_id) else { return };
let mut transactions = transactions.0;
// mark the transactions as received
self.transaction_fetcher
.remove_hashes_from_transaction_fetcher(transactions.iter().map(|tx| *tx.hash()));
let Some(peer) = self.peers.get_mut(&peer_id) else { return };
// track that the peer knows these transaction, but only if this is a new broadcast.
// If we received the transactions as the response to our `GetPooledTransactions``
// requests (based on received `NewPooledTransactionHashes`) then we already