-
Notifications
You must be signed in to change notification settings - Fork 9
multi: refresh asset VTXOs through the round (client) #1128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1713,7 +1713,7 @@ func (a *Ark) handleRefreshVTXOs(ctx context.Context, | |
| VTXOOutpoint: &op, | ||
| Amount: vtxo.Amount, | ||
| }) | ||
| vtxos = append(vtxos, types.VTXORequest{ | ||
| request := types.VTXORequest{ | ||
| PolicyTemplate: policyTemplate, | ||
| Amount: vtxo.Amount, | ||
| OwnerKey: vtxo.ClientKey, | ||
|
|
@@ -1726,7 +1726,18 @@ func (a *Ark) handleRefreshVTXOs(ctx context.Context, | |
| // debit on transfers_out, leaving only the | ||
| // operator fee as the net vtxo_balance change. | ||
| Origin: types.VTXOOriginRoundRefresh, | ||
| }) | ||
| } | ||
|
|
||
| // An asset leaf reissues its units through the round's | ||
| // asset transition. The carrier value is fixed so the seal | ||
| // quote can never shrink it, and the request never acts as | ||
| // the change output. | ||
| if vtxo.TaprootAssetRef != "" { | ||
| request.AssetRef = vtxo.TaprootAssetRef | ||
| request.AssetAmount = vtxo.TaprootAssetAmount | ||
| request.FixedAmount = true | ||
|
Comment on lines
+1735
to
+1738
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the selected batch contains only asset VTXOs, every replacement is marked AGENTS.md reference: wallet/AGENTS.md:L40-L42 Useful? React with 👍 / 👎. |
||
| } | ||
| vtxos = append(vtxos, request) | ||
| } | ||
|
|
||
| // Reserve the forfeit inputs through the VTXO manager before | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For upgraded wallets containing the explicitly supported historical root-only asset rows,
TaprootAssetRefis empty even thoughTaprootAssetRootis non-nil. This descriptor therefore misclassifies such a VTXO as Bitcoin-only, andhandleRefreshVTXOsemits a replacement request withoutAssetRef,AssetAmount, orFixedAmount; the refresh consequently cannot reissue the asset and may submit a destructive transition to an operator lacking conservation checks. Carry the root into this adapter and reject or recover metadata for root-only assets rather than using an empty reference as the Bitcoin discriminator.Useful? React with 👍 / 👎.