Skip to content

feat(wallet): list the asset locks that fund Platform from the wallet's own transactions - #8137

Merged
PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:feat/wallet-asset-lock-fundings
Nov 16, 2026
Merged

PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:feat/wallet-asset-lock-fundings

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

An identity registration or top-up locks coins into a credit output that pays a funding key derived from the wallet's seed. Nothing in the wallet points back at that lock. If Platform has not consumed it when a DashPay client loses its own records, as after a seed restore, the client cannot find it: it would fund a second lock with the same registration key, and top-up credits would stay stranded.

What was done?

interfaces::Wallet::listAssetLockFundings(keys) lists every credit output of a wallet asset lock that pays one of the given funding keys: txid, credit index, key, amount and status. It is derived only from the transactions the wallet holds, which a restore recovers by rescanning, so nothing new is persisted.

  • ACTIVE: not abandoned, and no conflict is mined.
  • INACTIVE: abandoned and unmined. It is still listed because it can still be mined.
  • CONFLICTED: a conflict is mined.

The status comes from the state the wallet records for the transaction, not from its depth. A rescan installs mined transactions above the last block the wallet has processed, where the depth would be negative, so a lock found there would otherwise read as conflicted.

Deriving the keys needs an unlocked wallet. There is no in-tree caller yet; the DashPay GUI that uses it comes in a later PR. This was the last commit of #8068 and is split out because it shares no code or state with the rescan work there. The two PRs touch adjacent lines, so whichever merges second needs a trivial rebase.

How Has This Been Tested?

wallet_tests/create_asset_lock_transaction is extended rather than adding a scenario:

  • the committed lock is listed ACTIVE and the abandoned conflict INACTIVE; a key that funds nothing lists nothing;
  • after the lock is mined, the conflict becomes CONFLICTED;
  • a wallet restored from the seed finds the mined lock after a rescan, and lists it ACTIVE while its processed height is still two blocks below the lock;
  • a locked wallet reports WALLET_LOCKED.

test_dash --run_test=wallet_tests,platformkeys_tests passes at this head (macOS arm64, depends build, --enable-debug --enable-werror, no GUI). When the commit was written, deriving the status from depth made the restored-wallet check fail with CONFLICTED; that reversion was not re-run for this split.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (if you have permission to set one)

🤖 Generated with Claude Code

…'s own transactions

An identity registration or top-up locks coins into a credit output that
pays a key derived from the wallet's seed. If Platform has not consumed
that lock when the GUI's own records are lost, as after a seed restore,
nothing pointed back at it: the GUI would fund a second lock with the
same registration key, and top-up credits stayed stranded.

listAssetLockFundings(keys) reads that inventory from the transactions
the wallet holds, which a restore recovers by rescanning: every credit
output of a wallet asset lock that pays one of the given funding keys,
with its txid, credit index, key, amount and status. ACTIVE is not
abandoned and has no mined conflict; INACTIVE is abandoned and unmined,
which can still be mined, so it stays listed; CONFLICTED has a mined
conflict. Nothing else is persisted. Deriving the keys needs an unlocked
wallet.

The status comes from the state the wallet records for the transaction,
not from its depth. Depth counts from the last block notification the
wallet processed, and a rescan installs mined transactions above it, so
a lock it finds two or more blocks higher would have a negative depth
and read as conflicted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cab00716-ec12-4809-bb3c-b1055d467d0c
Commits

Reviewing files that changed from the base of the PR and between 5c34dcf and c47973f.

Files selected for processing: 6

  • src/interfaces/wallet.h
  • src/wallet/interfaces.cpp
  • src/wallet/platformtypes.h
  • src/wallet/test/wallet_tests.cpp
  • src/wallet/wallet.cpp
  • src/wallet/wallet.h
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@thepastaclaw

thepastaclaw commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit c47973f) · triage: normal

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 1 + Phase 2

The PR cleanly adds wallet and interface support for locating asset-lock credit outputs by derived Platform funding keys. The implementation derives keys under the wallet lock, scans wallet-owned asset-lock transactions, preserves the requested status semantics, and includes coverage for conflicts, rescans, and locked wallets. Cppcheck and ClangFormat pass; the queued lint and failed milestone policy check do not indicate code defects.

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.1-sol (effort low) — This is a contained wallet/API behavior change involving asset-lock discovery, key derivation, transaction status classification, and rescan-related state handling, but it does not directly change funds movement, consensus, cryptographic primitives, or persistence formats.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — dash-core-commit-history (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — dash-core-commit-history (completed, effort high); agent phase2-reviewer

@thepastaclaw thepastaclaw added the pastaclaw:approved thepastaclaw's latest review approved this PR label Nov 13, 2026

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

PastaPastaPasta

This comment was marked as duplicate.

@PastaPastaPasta
PastaPastaPasta merged commit 45732d5 into dashpay:develop Nov 16, 2026
51 of 53 checks passed
@thepastaclaw thepastaclaw removed the pastaclaw:approved thepastaclaw's latest review approved this PR label Nov 16, 2026
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.

2 participants