Fix DOGE sweep insufficient funds error using subtractfeefromamount

- Use subtractfeefromamount=True parameter in sendtoaddress for DOGE sweeps
- This allows Dogecoin to automatically deduct network fee from the sweep amount
- Resolves 500 errors when trying to sweep the exact wallet balance
- Regular payment sweeps remain single-output transactions (no multi-output needed)
This commit is contained in:
Russell Ballestrini 2025-10-02 19:26:53 -04:00
parent f545e0e3e4
commit 24bd698ecd

View file

@ -1094,10 +1094,16 @@ def auto_sweep_payment_doge(client, crypto_payment: CryptoPayment, dbsession=Non
)
# Send the sweep transaction
tx_hash = client.sendtoaddress(
crypto_payment.shop_sweep_to_address,
float(sweep_amount),
f"Sweep for invoice {crypto_payment.invoice.id}",
# Use subtractfeefromamount=True so network fee is deducted from the sweep amount
tx_hash = client._call(
"sendtoaddress",
[
crypto_payment.shop_sweep_to_address,
float(sweep_amount),
f"Sweep for invoice {crypto_payment.invoice.id}",
"", # comment_to
True, # subtractfeefromamount
],
)
if tx_hash: