Skip to content

Feat: Allow using txindex with pruning #35240

Closed

Description

@cen1

Please describe the feature you'd like to see added.

Use case: I run an indexer but only care about blocks 30 days and newer.

I need to use -txindex but can't use pruning because they are incompatible and node refuses to start if both are set.

Except.. they are not really as far as I can understand. AI explained it like this:

  • txindex is a pointer to a raw block in file
  • pruning deletes the whole file
  • thus there is a fundamental issue that we end up with pointers pointing to deleted data

But for my use case this is completely irrelevant. Indexer will initially index the 30 days, then index from tip. Blocks older than 30 days will never be accessed again so the fact that the underlying file was deleted and txindex gracefully fails is completely fine.

So it seems to me the enforcement is essentially artificial and this could be allowed for people who want it and understand the consequences. Obviously can't change the current behavior but could hide it under extra force flag.

Hopefully the information is correct, otherwise I'd gladly be educated.

Activity

  1. maflcko commented on May 8, 2026

    @maflcko
    Member

    If you are only interested in a small subset of transaction ids that map to a block hash, you can just keep track of them in a wallet, or externally. Then, use the getrawtransaction block hash option.

  2. cen1 commented on May 8, 2026

    @cen1
    Author

    I'll look into it, ty.

  3. marshalokos commented on May 10, 2026

    @marshalokos

    I'm not interested in a small transaction so can you fix it for a better one

  4. marshalokos commented on May 11, 2026

    @marshalokos

    I want to see the balance and functionality

  5. maflcko commented on May 18, 2026

    @maflcko
    Member

    I'll look into it, ty.

    Ok, closing for now, I presume this is fixed now.

  6. deleted a comment from marshalokos on May 18, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions