From 7ec0606b08edcaf50edf3b7f4b0342b156a74ba6 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Thu, 8 Dec 2022 17:37:57 -0600 Subject: [PATCH] account for ct_fee --- lib/services/coins/particl/particl_wallet.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/services/coins/particl/particl_wallet.dart b/lib/services/coins/particl/particl_wallet.dart index 07e255bab..0249fb205 100644 --- a/lib/services/coins/particl/particl_wallet.dart +++ b/lib/services/coins/particl/particl_wallet.dart @@ -2376,6 +2376,15 @@ class ParticlWallet extends CoinServiceAPI { Logging.instance.log( "output is blinded (CT); cannot parse output values", level: LogLevel.Info); + final ct_fee = output["ct_fee"]!; + final fee_value = (Decimal.parse(ct_fee.toString()) * + Decimal.fromInt(Constants.satsPerCoin(coin))) + .toBigInt() + .toInt(); + Logging.instance.log( + "ct_fee ${ct_fee} subtracted from inputAmtSentFromWallet ${inputAmtSentFromWallet}", + level: LogLevel.Info); + inputAmtSentFromWallet += fee_value; } else if (output.containsKey('rangeproof') as bool) { // or valueCommitment or type: anon // TODO handle RingCT tx