Skip to content

Header inconsistency after invalidate/reconsider block #26245

Closed

Description

@fanquake

Demonstration using regtest.

# getblockchaininfo
  "chain": "regtest",
  "blocks": 0,
  "headers": 0,

Mine a block

# getblockchaininfo
  "chain": "regtest",
  "blocks": 1,
  "headers": 1,

Call invalidateblock

# getblockchaininfo
  "chain": "regtest",
  "blocks": 0,
  "headers": 0,
# getchaintips
    "height": 1,
    "hash": "06702ef73c7d8629294f8b6386646f888d60979932ba2ee45e3495d8f25006b5",
    "branchlen": 1,
    "status": "invalid"
  },
  {
    "height": 0,
    "hash": "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206",
    "branchlen": 0,
    "status": "active"

Call reconsiderblock

# getchaintips
    "height": 1,
    "hash": "06702ef73c7d8629294f8b6386646f888d60979932ba2ee45e3495d8f25006b5",
    "branchlen": 0,
    "status": "active"

Header count returned by getblockchaininfo is now < # of blocks.

# getblockchaininfo
  "chain": "regtest",
  "blocks": 1,
  "headers": 0,

Activity

  1. maflcko commented on Oct 4, 2022

    @maflcko
    Member

    Is this a regression?

  2. fanquake commented on Oct 4, 2022

    @fanquake
    MemberAuthor

    Is this a regression?

    Can recreate the same behaviour with builds of 23.x and 22.x.

  3. added a commit that references this issue on Nov 14, 2024
    85bcfee
  4. added a commit that references this issue on Jun 13, 2025
  5. locked and limited conversation to collaborators on Nov 14, 2025
  6. added 4 commits that reference this issue on Dec 1, 2026
    ded74a8
    78fd244
    c881d08
    c1a848f
  7. added 6 commits that reference this issue on Dec 4, 2026
    187a2c8
    b609b34
    3a8b048
    4457be2
    f6d2718
    f85a7d2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions