Skip to content

Instantly share code, notes, and snippets.

Created December 30, 2016 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/a3e0f84e1b3c0e06ae11b6e7f64cc227 to your computer and use it in GitHub Desktop.
Save anonymous/a3e0f84e1b3c0e06ae11b6e7f64cc227 to your computer and use it in GitHub Desktop.
function iterateThroughSwarm(address _node, uint _timeStamp) internal {
for(uint i = 0; i < dividendPathways[_node].length; i++) {
uint timeStamp = dividendPathways[_node][i].timeStamp;
if(timeStamp <= _timeStamp) {
bool human = isHuman[dividendPathways[_node][i].from];
if(human) humanCount++;
Node memory node = Node({
node: dividendPathways[_node][i].from,
parent: _node,
index: i
});
swarmTree.push(node);
iterateThroughSwarm(node.node, timeStamp);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment