Skip to content

Header inconsistency after invalidate/reconsider block #26245

@fanquake

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,

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