Skip to content

Commit

Permalink
Define knownPools in terms of listRegisteredPools.
Browse files Browse the repository at this point in the history
There's no point in fetching the entire set of all pool-related data
when all we really need is the set of valid pool IDs.
  • Loading branch information
jonathanknowles committed Sep 10, 2020
1 parent 5088a26 commit a41adbc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/shelley/src/Cardano/Wallet/Shelley/Pools.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ import qualified Cardano.Wallet.Api.Types as Api
import qualified Data.List as L
import qualified Data.Map.Merge.Strict as Map
import qualified Data.Map.Strict as Map
import qualified Data.Set as Set

--
-- Stake Pool Layer
Expand Down Expand Up @@ -194,7 +195,7 @@ newStakePoolLayer nl db@DBLayer {..} =
_knownPools
:: IO (Set PoolId)
_knownPools =
Map.keysSet <$> liftIO (readPoolDbData db minBound)
Set.fromList <$> liftIO (atomically listRegisteredPools)

_listPools
:: EpochNo
Expand Down

0 comments on commit a41adbc

Please sign in to comment.