From 24bd698ecdc61ced726725d32741e82deec214d9 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Thu, 2 Oct 2025 19:26:53 -0400 Subject: [PATCH] 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) --- make_post_sell/lib/crypto_watcher/__init__.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/make_post_sell/lib/crypto_watcher/__init__.py b/make_post_sell/lib/crypto_watcher/__init__.py index 14a4fce..17b5e97 100644 --- a/make_post_sell/lib/crypto_watcher/__init__.py +++ b/make_post_sell/lib/crypto_watcher/__init__.py @@ -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: