Optimize transaction creation #98

Merged
pitmutt merged 17 commits from rav001 into milestone2 2024-10-30 16:47:12 +00:00
Showing only changes of commit 1694898117 - Show all commits

View file

@ -137,10 +137,10 @@ createTransaction sapAnchor orchAnchor tSpend sSpend oSpend outgoing znet bh bui
processResult $! txResult processResult $! txResult
where where
processResult :: HexString -> Either TxError HexString processResult :: HexString -> Either TxError HexString
processResult input = processResult input
if BS.length (hexBytes input) > 1 | BS.length (hexBytes input) > 1 = Right input
then Right input | otherwise =
else case head (BS.unpack $ hexBytes input) of case head (BS.unpack $ hexBytes input) of
0 -> Left InsufficientFunds 0 -> Left InsufficientFunds
1 -> Left ChangeRequired 1 -> Left ChangeRequired
2 -> Left Fee 2 -> Left Fee