Tags: blockchainreg/pocket-core
Tags
Fixes cache data race bug. This is achieved in two ways: First, finish making the current height "unreadable". Second, make the lowest height in the cache also "unreadable". We kept the amount of accessible previous blocks the same by increasing the cache's capacity by one. The lowest height's situation is a hypothetical issue that could come up if an iterator is being generated for the lowest height in the cache when a Commit starts, given that it evicts the lowest height. By only returning information (aka "Reading from") heights that cannot be written to, we eliminate this class of issue without needing locks or other synchronization mechanisms.
PreviousNext