@@ -77,7 +77,7 @@ insertTx syncEnv isMember blkId epochNo slotNo applyResult blockIndex tx grouped
77
77
let ! mdeposits = if not (Generic. txValidContract tx) then Just (Coin 0 ) else lookupDepositsMap txHash (apDepositsMap applyResult)
78
78
let ! outSum = fromIntegral $ unCoin $ Generic. txOutSum tx
79
79
! withdrawalSum = fromIntegral $ unCoin $ Generic. txWithdrawalSum tx
80
- ! treasuryDonation = fromIntegral . unCoin $ Generic. txTreasuryDonation tx
80
+ ! treasuryDonation = unCoin $ Generic. txTreasuryDonation tx
81
81
hasConsumed = getHasConsumedOrPruneTxOut syncEnv
82
82
disInOut <- liftIO $ getDisableInOutState syncEnv
83
83
-- In some txs and with specific configuration we may be able to find necessary data within the tx body.
@@ -93,7 +93,7 @@ insertTx syncEnv isMember blkId epochNo slotNo applyResult blockIndex tx grouped
93
93
then pure (resolvedInputs, fees, Nothing )
94
94
else
95
95
let ! inSum = sum $ map unDbLovelace $ catMaybes amounts
96
- in pure (resolvedInputs, fees, Just $ fromIntegral (inSum + withdrawalSum) - fromIntegral outSum - fromIntegral fees)
96
+ in pure (resolvedInputs, fees, Just $ fromIntegral (inSum + withdrawalSum) - fromIntegral outSum - fees - treasuryDonation )
97
97
(_, _, Nothing ) -> do
98
98
-- Nothing in fees means a phase 2 failure
99
99
(resolvedInsFull, amounts) <- splitLast <$> mapM (resolveTxInputs hasConsumed True (fst <$> groupedTxOut grouped)) (Generic. txInputs tx)
@@ -118,7 +118,7 @@ insertTx syncEnv isMember blkId epochNo slotNo applyResult blockIndex tx grouped
118
118
, DB. txInvalidHereafter = DbWord64 . unSlotNo <$> Generic. txInvalidHereafter tx
119
119
, DB. txValidContract = Generic. txValidContract tx
120
120
, DB. txScriptSize = sum $ Generic. txScriptSizes tx
121
- , DB. txTreasuryDonation = DB. DbLovelace treasuryDonation
121
+ , DB. txTreasuryDonation = DB. DbLovelace ( fromIntegral treasuryDonation)
122
122
}
123
123
124
124
when (ioTxCBOR iopts) $ do
0 commit comments