Skip to content

Commit

Permalink
Remove txs in confirmed snapshot from inflight set
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly-iohk committed May 4, 2021
1 parent 4dd4154 commit d364bb1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/HydraSim/HeadNode/CoordinatedProtocolHandler.hs
Expand Up @@ -155,13 +155,15 @@ handleMessage conf _peer s (SigConfSn snapN asig)
validComp = (ms_verify_sn . hcMSig $ conf) avk (snapN, snoO snob) asig
isValid = unComp validComp
s' =
s
{ hsSnapNConf = snapN
, hsSnapSig = snob'
, hsSnapConf = snob
, hsTxsSig = hsTxsSig s Map.\\ reach (hsTxsSig s) (snoT snob')
, hsTxsConf = hsTxsConf s Map.\\ reach (hsTxsConf s) (snoT snob')
}
let reachableTxs = reach (hsTxsSig s) (snoT snob')
in s
{ hsSnapNConf = snapN
, hsSnapSig = snob'
, hsSnapConf = snob
, hsTxsSig = hsTxsSig s Map.\\ reachableTxs
, hsTxsConf = hsTxsConf s Map.\\ reach (hsTxsConf s) (snoT snob')
, hsTxsInflight = hsTxsInflight s Set.\\ Map.keysSet reachableTxs
}
handleMessage _ _ _ msg =
DecInvalid
(return ())
Expand Down

0 comments on commit d364bb1

Please sign in to comment.