[GEN-1815] Add coin selection strategy by feature flag - #564
Open
imclvr wants to merge 1 commit into
Open
Conversation
imclvr
commented
Aug 12, 2026
| public static List<UTXO> SelectUTXOsByClosest( | ||
| Wallet wallet, long satsAmount, List<UTXO> availableUTXOs, ILogger logger) | ||
| { | ||
| return new List<UTXO>(); |
Contributor
Author
There was a problem hiding this comment.
This won't fail for sure 😬
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a feature-flag switch for transaction input (UTXO) selection in CoinSelectionService, allowing the service to route between the existing “oldest-first” selection and a new “closest-to-amount” strategy.
Changes:
- Added
ENABLE_COIN_SELECTION_BY_CLOSEST-gated routing inCoinSelectionService.GetTxInputCoins. - Introduced a new
UTXOSelectionAlgorithms.SelectUTXOsByClosestentry point (currently stubbed). - Added tests to verify the feature-flag routing behavior, including a helper to create spendable UTXOs for
ToCoins().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/NodeGuard.Tests/Services/CoinSelectionServiceTests.cs | Adds routing tests for GetTxInputCoins under both flag states; adds spendable UTXO helper for coin conversion. |
| src/Services/CoinSelectionService.cs | Routes coin selection between “oldest-first” and “closest” based on a feature flag. |
| src/Helpers/UTXOSelectionAlgorithms.cs | Adds SelectUTXOsByClosest algorithm entry point (currently returns an empty selection). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
imclvr
force-pushed
the
feat/improve-coin-selection-refactor
branch
from
August 17, 2026 07:45
d879c5c to
cf3c772
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable utxo selection strategy by ff
Stack created with GitHub Stacks CLI • Give Feedback 💬