Skip to content

Commit bd73a04

Browse files
fix: serviceEvaluation valeu when the node has a malicious behavior
1 parent b0aef9e commit bd73a04

File tree

1 file changed

+13
-0
lines changed
  • src/main/java/reputation/node/models

1 file changed

+13
-0
lines changed

src/main/java/reputation/node/models/Node.java

+13
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,19 @@ private void requestAndEvaluateNodeService(
579579
/* Prestou o serviço. */
580580
if (!isNullable && sensorValue != null) {
581581
serviceEvaluation = 1;
582+
583+
if (
584+
this.getNodeType()
585+
.getNode()
586+
.getConductType()
587+
.toString()
588+
.equals("MALICIOUS")
589+
) {
590+
/* Necessário alterar aqui também, pois mesmo que esse valor seja
591+
alterado no momento de salvar na blockchain, esse valor será usado no
592+
cálculo da credibilidade. */
593+
serviceEvaluation = 0;
594+
}
582595
}
583596

584597
if (this.useCredibility) {

0 commit comments

Comments
 (0)