Fix Dogecoin & Monero multi-output refunds with proper fee handling #84
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/multi-output-refunds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
Summary by CodeRabbit
Walkthrough
Adds Dogecoin Makefile tools and config; extends DogecoinClient.sendmany signature; implements multi-output refunds for DOGE/XMR with fee buffering, balance checks, and retries; adds swept_confirmations field and migration; broadens crypto status vocabulary across views/templates; adjusts cart single-item redirect logic; adds tests for multi-output refunds.
Changes
Makefiledogecoin-check-feeanddogecoin-fix-feetargets, updates help text, anddogecoin-configappendspaytxfee/mintxfee(0.001) with explanatory comments todogecoin.conf.make_post_sell/lib/crypto_watcher/crypto_clients.pyDogecoinClient.sendmanysignature to acceptminconf: int = 1andcomment: str = ""; builds RPC params conditionally in the expected order before calling RPC.make_post_sell/lib/crypto_watcher/crypto_payment_rescue.pyDOGE_REFUND_FEE_BUFFER; implements multi-output refunds for DOGE and XMR (customer + shop sweep outputs); includes balance checks, optional env-driven fee buffer, account-derived/from-account fallback on insufficient funds, enhanced logging, and requiresshop_sweep_to_address. Refund results now includepayment_amount.make_post_sell/models/crypto_payment.py,make_post_sell/scripts/alembic/versions/0915b3ff883d_add_swept_confirmations_to_track_sweep_.pyswept_confirmationsinteger column (default 0) toCryptoPayment; Alembic migration adds column withserver_default="10"on upgrade and drops on downgrade.make_post_sell/views/crypto.py,make_post_sell/templates/crypto_checkout.j2,make_post_sell/templates/crypto_quotes_history.j2confirmed-overpay,confirmed-complete) and many refunded/not-refunded variants; updates status-to-display mappings, redirects, flashes, and UI conditionals to use the new status set.make_post_sell/views/cart.pymake_post_sell/lib/render.py,make_post_sell/lib/sanitize_html.pyshoptoCleaner(cleaner.shop = shop); allowsstyleattr onatags and validates/appendscolor:styling fromcleaner.shop.theme_link_colorinprotect_links.make_post_sell/tests/test_multi_output_refunds.pySequence Diagram(s)
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~60 minutes
Poem
📜 Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Free
📥 Commits
Reviewing files that changed from the base of the PR and between
2657f982ecand9432375bcb.📒 Files selected for processing (2)
make_post_sell/lib/render.py(1 hunks)make_post_sell/lib/sanitize_html.py(4 hunks)Comment
@coderabbitai helpto get the list of available commands and usage tips.changed the description
added 1 commit
9432375b- Add shop ribbon color styling to links in product and content descriptionsCompare with previous version
changed the description
mentioned in commit
fd267aec0f