Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.

Conversation

luca-moser
Copy link
Contributor

Description

Fixes transactions to be deemed invalid by their timestamp because the bypass via the transactionRequester.isTransactionRequested() doesn't work with the new request queue logic via #1530

Fixes # (issue)
#1541

Type of change

  • Bug fix (a non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@luca-moser luca-moser changed the title Fix: adds recently requested txs set to TransactionRequester Fix: Adds recently requested txs set to TransactionRequester Jul 25, 2019
@luca-moser luca-moser requested a review from GalRogozinski July 25, 2019 13:31
Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@@ -1,9 +1,7 @@
package com.iota.iri.network;

import java.security.SecureRandom;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm on my IDE I see that it is not being used.
Since you changed imports automatically I would think that it would have been removed automatically.

It is out of context of this PR, so I don't care too much

@@ -20,6 +18,7 @@

private static final Logger log = LoggerFactory.getLogger(TransactionRequester.class);
private final Set<Hash> transactionsToRequest = new LinkedHashSet<>();
private final Set<Hash> recentlyRequestedTransactions = Collections.synchronizedSet(new HashSet<>());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other option would be
ConcurrentHashMap.newKeySet() which is more performant under heavy contention.

However, I don't think we have too much contention here, so you probably made the more performant choice 👍

@GalRogozinski GalRogozinski merged commit bdfa879 into iotaledger-archive:dev Jul 25, 2019
@jakubcech jakubcech mentioned this pull request Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants