summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-08-10 20:59:37 -0400
committerjoe <joe@jerkface.net>2014-08-10 20:59:37 -0400
commitb042e6bae6cf60e10c13ddf48eecf9eb3cdd44c5 (patch)
tree638038db6a574e60e6a4155b858930a36fd46312
parentf4603b395c58881421f6e806fe12c077f9181183 (diff)
requirements documented for forwardMessage
-rw-r--r--SybilLimit.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/SybilLimit.hs b/SybilLimit.hs
index f2b983c..ad85cfd 100644
--- a/SybilLimit.hs
+++ b/SybilLimit.hs
@@ -139,7 +139,11 @@ updateRoute i (k,j) fs = jfromk $ ktoj fs
139 setFrom i x f = f { routesFrom = IntMap.insert i x (routesFrom f)} 139 setFrom i x f = f { routesFrom = IntMap.insert i x (routesFrom f)}
140 140
141 141
142-- | Note: an exception will be thrown if srcId is not a valid friend node. 142-- | Required:
143--
144-- (1) srcId must be a valid friend node.
145--
146-- (2) msg must be either ForwardRRMessage or BackwardRRMessage
143forwardMessage :: ThisNode -> (FriendNode -> IntMap Int) -> (NodeId,PeerMessage) -> (NodeId, PeerMessage) 147forwardMessage :: ThisNode -> (FriendNode -> IntMap Int) -> (NodeId,PeerMessage) -> (NodeId, PeerMessage)
144forwardMessage me next (srcId,msg) = msg' 148forwardMessage me next (srcId,msg) = msg'
145 where msg' = ( dest, msg { rrCount = rrCount msg + 1 } ) 149 where msg' = ( dest, msg { rrCount = rrCount msg + 1 } )