Skip to content

Commit

Permalink
run 'coinSelector' last in the multi-asset selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Jan 27, 2021
1 parent 2eb1e7b commit 8fc5683
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,13 @@ runSelection limit mExtraCoinSource available minimumBalance =
, leftover = available
}

-- NOTE: We run the 'coinSelector' last, because we know that there are
-- necessarily coins in all inputs. Therefore, after having ran the other
-- selectors, we may already have covered for coins and need not to select
-- extra inputs.
selectors :: [SelectionState -> m (Maybe SelectionState)]
selectors = coinSelector : fmap assetSelector minimumAssetQuantities
selectors =
reverse (coinSelector : fmap assetSelector minimumAssetQuantities)
where
assetSelector = runSelectionStep . assetSelectionLens
coinSelector = runSelectionStep coinSelectionLens
Expand Down

0 comments on commit 8fc5683

Please sign in to comment.