Fix checkresult
MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -1065,7 +1065,27 @@ namespace WalletWasabi.Services
builder.SignPSBT(psbt);
psbt.Finalize();
tx = psbt.ExtractTransaction();
- TransactionPolicyError[] checkResults = builder.Check(tx, feeRate);
+ TransactionPolicyError[] checkResults;
+ if (psbt.TryGetEstimatedFeeRate(out FeeRate actualFeeRate))
+ {
+ // Manually check the feerate, because some inaccuracy is possible.
+ var sb1 = feeRate.SatoshiPerByte;
+ var sb2 = actualFeeRate.SatoshiPerByte;
+ if (Math.Abs(sb1 - sb2) > 2) // 2s/b inaccuracy ok.
+ {
+ // So it'll generate a transactionpolicy error thrown below.
+ checkResults = builder.Check(tx, feeRate);
+ }
+ else
+ {
+ checkResults = builder.Check(tx);
+ }
+ }
+ else
+ {
+ checkResults = builder.Check(tx, feeRate);
+ }
+
if (checkResults.Length > 0)
{
throw new InvalidTxException(tx, checkResults);

Fix checkresult