File tree 1 file changed +6
-1
lines changed
simulation/src/LeiosProtocol/Short
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ leiosSimVizModel =
300
300
}
301
301
EventVote x ->
302
302
vs
303
- { voteMsgs = accumLeiosMsgs now nid event x vs. voteMsgs
303
+ { voteMsgs = adjustNumVotes event x $ accumLeiosMsgs now nid event x vs. voteMsgs
304
304
, voteDiffusionLatency = accumDiffusionLatency' now nid event x. id x vs. voteDiffusionLatency
305
305
}
306
306
accumEventVizState now (LeiosEventNode (LabelNode nid (PraosNodeEvent (PraosNodeEventGenerate blk)))) vs =
@@ -420,6 +420,11 @@ leiosSimVizModel =
420
420
secondsAgo30 :: Time
421
421
secondsAgo30 = addTime (- 30 ) now
422
422
423
+ -- | Vote messages contain multiple votes each, so we bump the count by that amount
424
+ adjustNumVotes :: BlockEvent -> VoteMsg -> LeiosSimVizMsgsState VoteId VoteMsg -> LeiosSimVizMsgsState VoteId VoteMsg
425
+ adjustNumVotes Generate msg vs = vs{numMsgsGenerated = numMsgsGenerated vs + fromIntegral msg. votes - 1 }
426
+ adjustNumVotes _ _ vs = vs
427
+
423
428
initMsgs :: LeiosSimVizMsgsState id msg
424
429
initMsgs =
425
430
LeiosSimVizMsgsState
You can’t perform that action at this time.
0 commit comments