Skip to content

Skip zero balances in sweeps#3412

Open
caydyan wants to merge 1 commit into
CounterpartyXCP:developfrom
caydyan:fix-sweep-zero-balances-3089
Open

Skip zero balances in sweeps#3412
caydyan wants to merge 1 commit into
CounterpartyXCP:developfrom
caydyan:fix-sweep-zero-balances-3089

Conversation

@caydyan

@caydyan caydyan commented Jun 9, 2026

Copy link
Copy Markdown

Fixes #3089.

This is a develop-based replacement for #3365.

Summary:

  • Add a gated sweep_skip_zero_balances protocol change.
  • Skip zero-quantity balance rows when sweeping balances after the gate.
  • Calculate sweep antispam fees from the balances/ownership categories actually being swept.
  • Avoid charging an XCP sweep fee when the gated path has no sweepable balances/ownership.
  • Preserve legacy behavior when the gate is disabled.

Tests:

  • .venv/bin/python -m pytest counterpartycore/test/units/messages/sweep_test.py -q
  • .venv/bin/python -m ruff check counterpartycore/lib/messages/sweep.py counterpartycore/test/units/messages/sweep_test.py
  • .venv/bin/python -m ruff format --check counterpartycore/lib/messages/sweep.py counterpartycore/test/units/messages/sweep_test.py
  • .venv/bin/python -m json.tool counterpartycore/protocol_changes.json
  • git diff --check

BTC payout address if this qualifies for a contributor/security reward: bc1qev5ant33v5y89qqjvcf4mh9hlax5svqf5xd7gc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant