Skip to content

platform-wallet: unconfirmed spend reservations from unauthenticated mempool transactions never expire #5225

Description

@lklimek

Summary

An unconfirmed (mempool) transaction that spends a wallet outpoint reserves that outpoint indefinitely. The reservation survives restart, and a rescan does not clear it. Only a conflicting InstantSend-locked or confirmed spend releases it.

Why this matters

dash-spv forwards peer mempool transactions to the wallet. The wallet recognises a spend by matching tracked outpoints and does not verify the spending signature. A connected peer can therefore relay an unsigned or never-mineable transaction that references a victim UTXO, and the UTXO becomes unspendable in that wallet:

Regression evidence: should_not_release_inputs_reserved_by_unconfirmed_spend passes with an empty scriptSig.

Expected

Legitimate pending sends keep their reservation until they confirm, are replaced, or expire. Unauthenticated peer observations cannot lock funds permanently. The fix must clear both the persisted reservation and the in-memory one, and must never release confirmed or InstantSend-locked spends.

Possible directions

  • Provenance: distinguish locally authored sends from peer observations when persisting.
  • Expiry: drop unconfirmed spend reservations that are not locally authored after a bound (time or block count), including on load.
  • Revalidation: verify input scripts before a peer mempool transaction may reserve an outpoint.

References

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions