Skip to content
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.

Commit

Permalink
Check weights even if a smart guy pushed it through
Browse files Browse the repository at this point in the history
the contract.
  • Loading branch information
abourget committed May 8, 2018
1 parent 2aa8dd5 commit 2ebd072
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions network.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,12 @@ func (net *Network) calculateWeights() error {
continue
}

fmt.Println("adding weight to", peerLink.Account)
// Weight defaults to 0
peerLinkPeer.TotalWeight += int(peerLink.Weight)
if peerLink.Weight > 100 {
fmt.Println("weight overboard for peer", peerLink.Account, ".. skipping!")
} else {
fmt.Println("adding weight to", peerLink.Account)
peerLinkPeer.TotalWeight += int(peerLink.Weight)
}
}

allPeers = append(allPeers, peer)
Expand Down

0 comments on commit 2ebd072

Please sign in to comment.