Skip to content

Commit fe917f3

Browse files
Use peerInfoPeer instead of pattern matching
1 parent b24e05c commit fe917f3

File tree

1 file changed

+8
-5
lines changed
  • ouroboros-network/src/Ouroboros/Network/BlockFetch/Decision

1 file changed

+8
-5
lines changed

ouroboros-network/src/Ouroboros/Network/BlockFetch/Decision/BulkSync.hs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,12 @@ fetchDecisionsBulkSyncM
233233
-- so we take a new current time.
234234
when (isNothing peersOrderCurrent) $
235235
case theDecision of
236-
Just (_, (_,_,_,thePeer,_)) -> do
236+
Just (_, peerInfo) -> do
237237
peersOrderStart <- getMonotonicTime
238-
writePeersOrder $ peersOrder {peersOrderCurrent = Just thePeer, peersOrderStart}
238+
writePeersOrder $ peersOrder
239+
{ peersOrderCurrent = Just (peerInfoPeer peerInfo),
240+
peersOrderStart
241+
}
239242
_ -> pure ()
240243

241244
pure $
@@ -487,9 +490,9 @@ selectThePeer
487490
-- we bind the lists in the comprehension is capital.
488491
let peersOrdered =
489492
[ (candidate, peerInfo)
490-
| peer' <- peersOrderAll peersOrder,
491-
(candidate, peerInfo@(_, _, _, peer, _)) <- peers,
492-
peer == peer'
493+
| peer <- peersOrderAll peersOrder,
494+
(candidate, peerInfo) <- peers,
495+
peerInfoPeer peerInfo == peer
493496
]
494497

495498
-- Return the first peer in that order, and decline all the ones that were

0 commit comments

Comments
 (0)