Skip to content

Commit

Permalink
fix: cleaning the node with services list only after evaluating the n…
Browse files Browse the repository at this point in the history
…ode service provider
  • Loading branch information
AllanCapistrano committed Mar 18, 2024
1 parent bbf9472 commit 16d3548
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/reputation/node/models/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,13 @@ public void useNodeService() {
this.setRequestingNodeServices(false);
this.setLastNodeServiceTransactionType(null);
}

try {
this.mutexNodesServices.lock();
this.nodesWithServices.clear();
} finally {
this.mutexNodesServices.unlock();
}
}
}

Expand Down Expand Up @@ -1142,7 +1149,6 @@ public void update(Object object, Object object2) {
if (receivedTransaction.getType() == expectedTransactionType) {
try {
this.mutexNodesServices.lock();
this.nodesWithServices.clear();
this.nodesWithServices.add(receivedTransaction);
} finally {
this.mutexNodesServices.unlock();
Expand Down

0 comments on commit 16d3548

Please sign in to comment.