cryptonote_protocol: prevent duplicate txs in fluff queue

1. Fix duplicate transaction #9335
2. Add test for cases where there are duplicate transaction in fluff

Co-authored-by: Boog900 <boog900@tutanota.com>
This commit is contained in:
0xFFFC0000 2024-06-05 16:33:15 +00:00
parent 24ccaba6ef
commit 8dbc361e98
No known key found for this signature in database
GPG key ID: 650F7C2B7BDA3819
2 changed files with 59 additions and 0 deletions

View file

@ -396,6 +396,8 @@ namespace levin
for (auto& connection : connections)
{
std::sort(connection.first.begin(), connection.first.end()); // don't leak receive order
connection.first.erase(std::unique(connection.first.begin(), connection.first.end()),
connection.first.end());
make_payload_send_txs(*zone_->p2p, std::move(connection.first), connection.second, zone_->pad_txs, true);
}