Skip to content

Commit a1d458b

Browse files
committed
fix: spark mint fee vsize error
1 parent 6a00d1f commit a1d458b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1741,8 +1741,12 @@ mixin SparkInterface<T extends ElectrumXCurrencyInterface>
17411741
throw Exception("Transaction too large");
17421742
}
17431743

1744+
const nBytesBuffer = 10;
17441745
final nFeeNeeded = BigInt.from(
1745-
estimateTxFee(vSize: nBytes, feeRatePerKB: feesObject.medium),
1746+
estimateTxFee(
1747+
vSize: nBytes + nBytesBuffer,
1748+
feeRatePerKB: feesObject.medium,
1749+
),
17461750
); // One day we'll do this properly
17471751

17481752
if (nFeeRet >= nFeeNeeded) {
@@ -1993,6 +1997,7 @@ mixin SparkInterface<T extends ElectrumXCurrencyInterface>
19931997
),
19941998
);
19951999

2000+
Logging.instance.i("nFeeRet=$nFeeRet, vSize=${data.vSize}");
19962001
if (nFeeRet.toInt() < data.vSize!) {
19972002
Logging.instance.w(
19982003
"Spark mint transaction failed: $nFeeRet is less than ${data.vSize}",

0 commit comments

Comments
 (0)