monero-project/monero

daemon can send duplicate transactions, causing disconnects

selsta opened this issue · 0 comments

Since #8916 peers that send duplicate transactions gets dropped. This usually isn't an issue, but when running a daemon with --max-txpool-weight it's possible that duplicate transactions can get into the fluff queue.

Quoting @Boog900 from #9317 (comment)

If you receive a tx, add it to your fluff queue, drop the tx from the txpool, then receive it again, it is added to the fluff queue a second time. When the fluff timer fires we would then broadcast a message with the same tx twice causing the peer to disconnect.

Relevant code:

bool make_payload_send_txs(connections& p2p, std::vector<blobdata>&& txs, const boost::uuids::uuid& destination, const bool pad, const bool fluff)
{
epee::byte_slice blob = make_tx_message(std::move(txs), pad, fluff).finalize_notify(NOTIFY_NEW_TRANSACTIONS::ID);
return p2p.send(std::move(blob), destination);
}