-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMaliciousNode.java
More file actions
33 lines (26 loc) · 890 Bytes
/
MaliciousNode.java
File metadata and controls
33 lines (26 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;
public class MaliciousNode implements Node {
private Set<Transaction> pendingTransactions = new HashSet<>();
private Set<Transaction> emptySet = new HashSet<>();
public MaliciousNode(double p_graph, double p_malicious, double p_txDistribution, int numRounds) {
}
public void setFollowees(boolean[] followees) {
return;
}
public void setPendingTransaction(Set<Transaction> pendingTransactions) {
this.pendingTransactions.addAll(pendingTransactions);
}
public Set<Transaction> sendToFollowers() {
if (Math.random() < 0.5) {
return pendingTransactions;
} else {
return emptySet;
}
}
public void receiveFromFollowees(Set<Candidate> candidates) {
// System.out.println();
return;
}
}