Skip to content

Conversation

@DashCoreAutoGuix
Copy link
Owner

Summary

Backport of Bitcoin PR bitcoin#25685 which refactors coin selection to improve transaction creation performance by separating pre-selected input handling.

Key changes:

  • Introduces FetchSelectedInputs() to validate and fetch pre-selected inputs
  • Refactors SelectCoins() to accept PreSelectedInputs parameter
  • Adds AddInputs() and Merge() methods to SelectionResult
  • Updates AutomaticCoinSelection() for cleaner separation of concerns

Dash-specific adaptations

  • Uses 1-parameter ComputeAndSetWaste() (Dash lacks GetChange() from wallet: return change from SelectionResult bitcoin/bitcoin#25647)
  • Removes HasInputWeight/GetInputWeight calls (not in Dash CCoinControl)
  • Adapts tests for LEGACY output type (Dash has no SegWit/bech32)
  • Excludes wallet_create_tx benchmark (requires kernel/chain.h infrastructure)
  • Updates preset_inputs_test to reflect new behavior where all preset inputs are used

Test plan

  • Build succeeds
  • coinselector_tests unit tests pass
  • Functional tests for wallet_send, rpc_fundrawtransaction, rpc_psbt

Bitcoin PR: bitcoin#25685

🤖 Generated with Claude Code

…pre-set-inputs fetching responsibility from Coin Selection

This backport:
- Introduces FetchSelectedInputs() to handle pre-selected input validation
- Refactors SelectCoins() to use PreSelectedInputs parameter
- Adds AddInputs() and Merge() methods to SelectionResult
- Updates AutomaticCoinSelection() to handle coin selection separately
- Removes const from SelectionResult::m_target and m_algo to support Merge

Dash-specific adaptations:
- Uses 1-parameter ComputeAndSetWaste (Dash does not have GetChange yet)
- Removes HasInputWeight/GetInputWeight calls (not in Dash CCoinControl)
- Adapts tests to use LEGACY output type (Dash has no SegWit)
- Excludes wallet_create_tx benchmark (requires kernel/chain.h infrastructure)
- Updates preset_inputs_test to reflect new behavior

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Dec 6, 2025

Warning

Rate limit exceeded

@DashCoreAutoGuix has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 21 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 9cf919c and 380dfea.

📒 Files selected for processing (12)
  • src/qt/sendcoinsdialog.cpp (1 hunks)
  • src/test/util/wallet.cpp (1 hunks)
  • src/test/util/wallet.h (2 hunks)
  • src/wallet/coincontrol.h (1 hunks)
  • src/wallet/coinselection.cpp (1 hunks)
  • src/wallet/coinselection.h (2 hunks)
  • src/wallet/spend.cpp (5 hunks)
  • src/wallet/spend.h (2 hunks)
  • src/wallet/test/coinselector_tests.cpp (7 hunks)
  • test/functional/rpc_fundrawtransaction.py (2 hunks)
  • test/functional/rpc_psbt.py (1 hunks)
  • test/functional/wallet_send.py (1 hunks)
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch backport-0.25-batch-480-pr-25685

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

3 participants