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 26, 2021
1 parent 271cfb1 commit cb9545f
Showing 1 changed file with 6 additions and 1 deletion.
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 cb9545f

Please sign in to comment.