Skip to content
Snippets Groups Projects
Commit c9936bd3 authored by Jarrod Pas's avatar Jarrod Pas
Browse files

Fixes ordering of cbf and ncf

parent 8788de13
No related branches found
No related tags found
1 merge request!3Version 0.2
......@@ -50,14 +50,6 @@ def hcbf(self, packet, state):
# lp(max_lp) == lp(self)
elif not_local_community:
max_ncf = max(not_local_community, key=ncf)
if ncf(max_ncf) > ncf(self):
send(max_ncf, 'ncf')
return True
elif ncf(max_ncf) < ncf(self):
return False
# ncf(max_ncf) == ncf(self)
max_cbc = max(not_local_community, key=cbc)
if cbc(max_cbc) > cbc(self):
send(max_cbc, 'cbc')
......@@ -66,6 +58,14 @@ def hcbf(self, packet, state):
return False
# cbc(max_cbc) == cbc(self)
max_ncf = max(not_local_community, key=ncf)
if ncf(max_ncf) > ncf(self):
send(max_ncf, 'ncf')
return True
elif ncf(max_ncf) < ncf(self):
return False
# ncf(max_ncf) == ncf(self)
elif local_community:
max_ui = max(local_community, key=ui)
if ui(max_ui) > ui(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment