Skip to content

Commit

Permalink
GH-1155 Fix de-dup trx logic
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Feb 24, 2025
1 parent 5a46f8e commit 1ad869c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2770,7 +2770,7 @@ namespace eosio {
return added;
}

// return true if trx already received, adds to local trxs with connection_id
// return true if trx not already received, adds to local trxs with connection_id
bool dispatch_manager::add_txn(const transaction_id_type& id, const time_point_sec& trx_expires, uint32_t connection_id ) {
fc::lock_guard g( local_txns_mtx );
bool contains = local_txns.get<by_id>().contains( id );
Expand All @@ -2781,7 +2781,7 @@ namespace eosio {
.id = id,
.expires = expires,
.connection_id = connection_id} );
return contains;
return !contains;
}

void dispatch_manager::expire_txns() {
Expand Down

0 comments on commit 1ad869c

Please sign in to comment.