Skip to content

Investigate Blockchair 'bad-txns-inputs-spent' error during Zcash swaps #11353

@coderabbitai

Description

@coderabbitai

Problem

During testing of Zcash Ledger support, swapping took multiple attempts to succeed due to Blockchair API errors.

Error Details

Blockchair returned the following error response:

{
    "data": null,
    "context": {
        "code": 400,
        "source": "R",
        "error": "Invalid transaction. Error: 18: bad-txns-inputs-spent",
        "market_price_usd": 428.95,
        "cache": {
            "live": true,
            "duration": 120,
            "since": "2025-12-10 12:19:15",
            "until": "2025-12-10 12:21:15",
            "time": null
        },
        "api": {
            "version": "2.0.95-ie",
            "last_major_update": "2022-11-07 02:00:00",
            "next_major_update": "2023-11-12 02:00:00",
            "documentation": "https://blockchair.com/api/docs",
            "notice": "Try out our new API v.3: https://3xpl.com/data"
        },
        "servers": "API4,ZEC6",
        "time": 0.0015649795532226562,
        "render_time": 0.0026700496673583984,
        "full_time": 0.004235029220581055,
        "request_cost": 1
    }
}

Context

The error "bad-txns-inputs-spent" (Error code 18) indicates that the transaction inputs were already spent, suggesting potential issues with UTXO management or transaction broadcasting/retry logic.

Investigation Needed

  • Determine if this is a transient issue with Blockchair's API
  • Review UTXO selection and management for Zcash transactions
  • Check if retry logic is properly handling spent inputs
  • Consider if we need better error handling or user feedback for this scenario

Related

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions