Repository navigation
fix(tokens): wallet asset handling, reserved tickers and BDX input asset checks - #244
Merged
victor-tucci merged 8 commits intoDec 2, 2026
Conversation
Reject token inputs when constructing BDX transactions to prevent cross-asset input selection.
The ring-assembly side of get_outs gated each saved ring member with `out < num_outs`, comparing the member's real global output index against num_outs, which on the rct path is a per-asset bucket count, not an index bound. Native and token rct outputs share one global index space while that count is per asset, so saved members were almost always dropped and the ring refilled with fresh random decoys. Re-spending a key image then produced a different ring for the same key image, and intersecting the two reveals the real output. Reuse a saved member iff it is one of the outputs actually requested for the input (the request list is seeded from the same saved ring), matching the request-building side, so the assembled ring equals the saved ring. Drop the per-asset num_outs recomputation that only fed the broken comparison.
Enforce asset type validation for BDX transaction inputs
on_unconfirmed_money_received carried only an amount, so the CLI formatted a pending privacy-token payment as BDX. The callback now carries the token id and the CLI formats the amount with it. The wallet currently fetches only flash transactions from the pool, so this path is not reached for incoming payments today; the change keeps it correct if non-flash pool scanning is ever enabled.
create_transactions_2 fed destinations to the selection loop in their original order, but the loop only applies a picked input's leftover value to a run of consecutive same-asset destinations. A token destination between native ones cut the native run short, so a single large native input paid only the first recipient and its remainder was discarded, exhausting the wallet mid-batch and failing with "Failed to find a way to create transactions" despite ample balance. Stable-sort destinations by token id (native first) so each asset's recipients are contiguous and one input can pay them all; skipped when subtract_fee_from_outputs indexes destinations. Also broaden the bulletproof+ output-count guard in transfer_selected_rct from token-only to every transaction, before and after construction, so a transfer to more than TX_BULLETPROOF_PLUS_MAX_OUTPUTS (16) recipients fails with a clear message instead of an opaque "invalid bulletproofs_plus" rct serialization error.
fix(wallet): reuse saved rings on re-spend, and fix mixed-asset transfer construction
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
victor-tucci
merged commit Dec 2, 2026
de7c523
into
Beldex-Coin:feature-privacy-token
2 checks passed
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.
No description provided.