Fix Dogecoin multi-output refunds with proper fee handling
- Add payment amount to shop output for overpayment refunds - Both XMR and DOGE now send payment + restocking fee to shop - Fix insufficient funds error by using conservative fee buffer (0.01 DOGE) - Round outputs down to 3 decimal places to avoid precision issues - Update sendmany to try actual account first (where funds are located) - Add better error handling for different account formats - Fix fee calculation to properly account for Dogecoin's fee-on-top model The issue was that sendmany adds network fee on top of outputs, and we were trying to send exactly the wallet balance, leaving no room for fees. Now we reserve 0.01 DOGE for fees and round conservatively.
This commit is contained in:
parent
958a003f35
commit
d2d09e8851
10 changed files with 661 additions and 157 deletions
42
Makefile
42
Makefile
|
|
@ -58,6 +58,8 @@ help:
|
|||
@echo " make dogecoin-node - Start Dogecoin daemon (pruned mode)"
|
||||
@echo " make dogecoin-node-full - Start Dogecoin daemon (full blockchain)"
|
||||
@echo " make dogecoin-status - Check sync status and wallet info"
|
||||
@echo " make dogecoin-check-fee - Check current transaction fee setting"
|
||||
@echo " make dogecoin-fix-fee - Fix high transaction fee (sets to 0.001 DOGE)"
|
||||
@echo ""
|
||||
@echo "WALLET MANAGEMENT:"
|
||||
@echo " make sweep-check - Check hot wallet balances (dev tool)"
|
||||
|
|
@ -180,9 +182,10 @@ http: venv
|
|||
@echo "Starting simple HTTP server on port 8000..."
|
||||
$(PYTHON) -m http.server 8000
|
||||
|
||||
# Run the crypto watcher service for monitoring Monero payments.
|
||||
# Run the crypto watcher service for monitoring crypto payments.
|
||||
crypto-watcher: venv config
|
||||
@echo "Starting crypto payment watcher..."
|
||||
@echo "💡 TIP: If Dogecoin refunds fail, check fee: make dogecoin-check-fee"
|
||||
$(VENV_DIR)/bin/crypto_watcher $(DATA_DIR)/$(CONFIG_FILE)
|
||||
|
||||
# Run the crypto watcher once (for testing or manual processing).
|
||||
|
|
@ -564,6 +567,12 @@ dogecoin-config: check-dogecoin
|
|||
@echo "" >> $(HOME)/.dogecoin/dogecoin.conf
|
||||
@echo "# Hot wallet for Make Post Sell" >> $(HOME)/.dogecoin/dogecoin.conf
|
||||
@echo "wallet=make_post_sell_hot_wallet" >> $(HOME)/.dogecoin/dogecoin.conf
|
||||
@echo "" >> $(HOME)/.dogecoin/dogecoin.conf
|
||||
@echo "# Transaction fee settings" >> $(HOME)/.dogecoin/dogecoin.conf
|
||||
@echo "# Set reasonable fee for multi-output transactions (sendmany)" >> $(HOME)/.dogecoin/dogecoin.conf
|
||||
@echo "paytxfee=0.001" >> $(HOME)/.dogecoin/dogecoin.conf
|
||||
@echo "# Minimum fee per KB (prevents 0-fee transactions)" >> $(HOME)/.dogecoin/dogecoin.conf
|
||||
@echo "mintxfee=0.001" >> $(HOME)/.dogecoin/dogecoin.conf
|
||||
@echo ""
|
||||
@echo "✓ Configuration created at: $(HOME)/.dogecoin/dogecoin.conf"
|
||||
@echo ""
|
||||
|
|
@ -621,6 +630,37 @@ dogecoin-node-full: check-dogecoin
|
|||
-rpcallowip=127.0.0.1 \
|
||||
-server=1
|
||||
|
||||
# Check and fix Dogecoin transaction fee
|
||||
dogecoin-check-fee: check-dogecoin
|
||||
@echo "=== Checking Dogecoin Transaction Fee ==="
|
||||
@if ! dogecoin-cli getwalletinfo >/dev/null 2>&1; then \
|
||||
echo "❌ Dogecoin daemon not running"; \
|
||||
echo "Start with: make dogecoin-node"; \
|
||||
exit 1; \
|
||||
fi
|
||||
@fee=$$(dogecoin-cli getwalletinfo | grep paytxfee | awk '{print $$2}' | tr -d ','); \
|
||||
echo "Current transaction fee: $$fee DOGE"; \
|
||||
if [ "$$(echo "$$fee > 0.001" | bc -l)" = "1" ]; then \
|
||||
echo "⚠️ WARNING: Transaction fee is too high!"; \
|
||||
echo "This may cause sendmany (multi-output transactions) to fail."; \
|
||||
echo "Run 'make dogecoin-fix-fee' to set reasonable fee."; \
|
||||
else \
|
||||
echo "✓ Transaction fee is reasonable"; \
|
||||
fi
|
||||
|
||||
# Set reasonable Dogecoin transaction fee
|
||||
dogecoin-fix-fee: check-dogecoin
|
||||
@echo "=== Setting Dogecoin Transaction Fee ==="
|
||||
@if ! dogecoin-cli getwalletinfo >/dev/null 2>&1; then \
|
||||
echo "❌ Dogecoin daemon not running"; \
|
||||
echo "Start with: make dogecoin-node"; \
|
||||
exit 1; \
|
||||
fi
|
||||
@echo "Setting transaction fee to 0.001 DOGE..."
|
||||
@dogecoin-cli settxfee 0.001
|
||||
@echo "✓ Transaction fee updated"
|
||||
@echo "New fee: $$(dogecoin-cli getwalletinfo | grep paytxfee | awk '{print $$2}' | tr -d ',') DOGE"
|
||||
|
||||
# Check Dogecoin sync status and wallet info
|
||||
dogecoin-status: check-dogecoin
|
||||
@echo "=== Dogecoin Node Status ==="
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue