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:
parent
f545e0e3e4
commit
24bd698ecd
1 changed files with 10 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue