var isTransmitterAServer bool = infosNode.Is_a_server_address(addrTransmitter)
for_,transactionInDatabase:=rangeDB{
iftransactionInDatabase.Id==trans.Id{
ack.Id=trans.Id
transactionToRate=transactionInDatabase
}
}
if !isTransmitterAServer { //Self data is considered as correct
// todo add stuff
messageReceivedJSON.Body, err = db.Get_transaction(transToCheck.Id) //The client only gives the transaction Id. Future root has to set the data corresponding to this Id
if err != nil {
ifack.Id!=""{
fmt.Println(err.Error())
iftransactionToRate.Receiver!=trans.Receiver{
return -1
ack.AmountOfCorrectNode=0
ack.TotalNodes=1
}
iftransactionToRate.Sender!=trans.Sender{
ack.AmountOfCorrectNode=0
ack.TotalNodes=1
}
iftransactionToRate.Amount!=trans.Amount{
ack.AmountOfCorrectNode=0
ack.TotalNodes=1
}
}
} else {
if db.Is_transaction_valid(transToCheck) == -1 {
selfNodeAnswerVote.Percentage = 0.0
}
}
ifack.TotalNodes==0{
ack.AmountOfCorrectNode=1
ack.TotalNodes=1
}
}
if !isTransmitterAServer {
varnewAckAckTransaction
reach:=false
count:=0
limit:=len(config.Neighbours)
ifstimulatedByClient{
reach=true
reach=true
infosNode.Send_to_all_neighbours(messageReceivedJSON, portString) //vote sent to children