File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,6 @@ capUTxO utxo target
125
125
-- \| Helper function to recursively select and split UTxO outputs to reach the target value.
126
126
go foundSoFar leftovers currentSum sorted
127
127
| currentSum == target = (foundSoFar, leftovers)
128
- | null sorted = (foundSoFar, leftovers)
129
128
| otherwise = case take 1 sorted of
130
129
[] -> (foundSoFar, leftovers)
131
130
(txIn, txOut) : _ ->
@@ -142,13 +141,11 @@ capUTxO utxo target
142
141
-- Split the output to meet the target exactly.
143
142
let cappedValue = target - currentSum
144
143
leftoverVal = x - cappedValue
145
- newTxIn1 = txIn
146
- newTxIn2 = txIn
147
144
cappedTxOut = updateTxOutValue txOut cappedValue
148
145
leftoverTxOut = updateTxOutValue txOut leftoverVal
149
146
in go
150
- (foundSoFar <> UTxO. singleton newTxIn1 cappedTxOut)
151
- (UTxO. difference leftovers (UTxO. singleton txIn txOut) <> UTxO. singleton newTxIn2 leftoverTxOut)
147
+ (foundSoFar <> UTxO. singleton txIn cappedTxOut)
148
+ (UTxO. difference leftovers (UTxO. singleton txIn txOut) <> UTxO. singleton txIn leftoverTxOut)
152
149
(currentSum + cappedValue)
153
150
(removeOne (txIn, txOut) sorted)
154
151
You can’t perform that action at this time.
0 commit comments