Skip to content

Commit 50d1235

Browse files
committed
ChainDB.getIsValid: remove caveat about blocks from the future
Since #525 and #1269, the ChainDB never observes blocks the future, so this caveat does not apply anymore.
1 parent 64ab9bd commit 50d1235

File tree

1 file changed

+3
-4
lines changed
  • ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl

1 file changed

+3
-4
lines changed

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/Query.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,9 @@ getIsValid CDB{..} = do
191191
prevApplied <- LedgerDB.getPrevApplied cdbLedgerDB
192192
invalid <- forgetFingerprint <$> readTVar cdbInvalid
193193
return $ \pt@(RealPoint _ hash) ->
194-
-- Blocks from the future that were valid according to the ledger but
195-
-- that exceeded the max clock skew will be in 'prevApplied' *and*
196-
-- 'invalid'. So we first check 'invalid' before 'prevApplied'. See
197-
-- #2413.
194+
-- A block can not both be in the set of invalid blocks and
195+
-- previously-applied blocks, so the order in which we check them does not
196+
-- matter.
198197
if | Map.member hash invalid -> Just False
199198
| Set.member pt prevApplied -> Just True
200199
| otherwise -> Nothing

0 commit comments

Comments
 (0)