diff options
author | joe <joe@jerkface.net> | 2014-08-10 20:59:37 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-08-10 20:59:37 -0400 |
commit | b042e6bae6cf60e10c13ddf48eecf9eb3cdd44c5 (patch) | |
tree | 638038db6a574e60e6a4155b858930a36fd46312 | |
parent | f4603b395c58881421f6e806fe12c077f9181183 (diff) |
requirements documented for forwardMessage
-rw-r--r-- | SybilLimit.hs | 6 |
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 | ||
143 | forwardMessage :: ThisNode -> (FriendNode -> IntMap Int) -> (NodeId,PeerMessage) -> (NodeId, PeerMessage) | 147 | forwardMessage :: ThisNode -> (FriendNode -> IntMap Int) -> (NodeId,PeerMessage) -> (NodeId, PeerMessage) |
144 | forwardMessage me next (srcId,msg) = msg' | 148 | forwardMessage me next (srcId,msg) = msg' |
145 | where msg' = ( dest, msg { rrCount = rrCount msg + 1 } ) | 149 | where msg' = ( dest, msg { rrCount = rrCount msg + 1 } ) |