Skip to content

Commit

Permalink
fix change UTxO calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed May 21, 2019
1 parent 6b5530c commit d380903
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/core/src/Cardano/Wallet/Primitive/Model.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ import Control.Monad
( foldM, forM )
import Control.Monad.Trans.State.Strict
( State, evalState, runState, state )
import Data.Foldable
( fold )
import Data.Generics.Internal.VL.Lens
( (^.) )
import Data.Generics.Labels
Expand Down Expand Up @@ -329,10 +327,8 @@ changeUTxO
-> Set Tx
-> s
-> UTxO
changeUTxO proxy pending = evalState $ do
ourUtxo <- mapM (state . utxoOurs proxy) (Set.toList pending)
let ins = txIns pending
return $ fold ourUtxo `restrictedBy` ins
changeUTxO proxy pending = evalState $
mconcat <$> mapM (state . utxoOurs proxy) (Set.toList pending)

-- | Construct our _next_ UTxO (possible empty) from a transaction by selecting
-- outputs that are ours. It is important for the transaction outputs to be
Expand Down

0 comments on commit d380903

Please sign in to comment.