Skip to content

Commit 490dc76

Browse files
committed
taprpc+rpc: Apply garbage collection in AnchorVirtualPsbts
1 parent f97bb0f commit 490dc76

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

rpcserver.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,8 +2671,17 @@ func (r *rpcServer) AnchorVirtualPsbts(ctx context.Context,
26712671
prevID.OutPoint.String())
26722672
}
26732673

2674+
// Fetch zero-value UTXOs that should be swept as additional inputs.
2675+
zeroValueInputs, err := r.cfg.AssetStore.FetchZeroValueAnchorUTXOs(ctx)
2676+
if err != nil {
2677+
return nil, fmt.Errorf("unable to fetch zero-value "+
2678+
"UTXOs: %w", err)
2679+
}
2680+
26742681
resp, err := r.cfg.ChainPorter.RequestShipment(
2675-
tapfreighter.NewPreSignedParcel(vPackets, inputCommitments, ""),
2682+
tapfreighter.NewPreSignedParcel(
2683+
vPackets, inputCommitments, zeroValueInputs, "",
2684+
),
26762685
)
26772686
if err != nil {
26782687
return nil, fmt.Errorf("error requesting delivery: %w", err)
@@ -3847,7 +3856,8 @@ func (r *rpcServer) BurnAsset(ctx context.Context,
38473856

38483857
resp, err := r.cfg.ChainPorter.RequestShipment(
38493858
tapfreighter.NewPreSignedParcel(
3850-
fundResp.VPackets, fundResp.InputCommitments, in.Note,
3859+
fundResp.VPackets, fundResp.InputCommitments,
3860+
fundResp.ZeroValueInputs, in.Note,
38513861
),
38523862
)
38533863
if err != nil {

0 commit comments

Comments
 (0)