Skip to content

confirmBuyResale doesn't re-check the listing is still active #14

Description

@presidojay1

buildBuyResaleTx verifies ticket.status === RESALE before allowing a purchase to be built, but confirmBuyResale performs the on-chain submit and DB update with no such check. If a listing is cancelled or already sold between build and confirm, confirmBuyResale will still reassign ownership and mark the ticket VALID, leaving DB state inconsistent.

Suggested fix: In confirmBuyResale, fetch the ticket first and throw BadRequestException('This ticket is not listed for resale') if ticket.status !== TicketStatus.RESALE, mirroring buildBuyResaleTx.

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