Demonstration using regtest.
0# getblockchaininfo
1 "chain": "regtest",
2 "blocks": 0,
3 "headers": 0,
Mine a block
0# getblockchaininfo
1 "chain": "regtest",
2 "blocks": 1,
3 "headers": 1,
Call invalidateblock
0# getblockchaininfo
1 "chain": "regtest",
2 "blocks": 0,
3 "headers": 0,
4# getchaintips
5 "height": 1,
6 "hash": "06702ef73c7d8629294f8b6386646f888d60979932ba2ee45e3495d8f25006b5",
7 "branchlen": 1,
8 "status": "invalid"
9 },
10 {
11 "height": 0,
12 "hash": "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206",
13 "branchlen": 0,
14 "status": "active"
Call reconsiderblock
0# getchaintips
1 "height": 1,
2 "hash": "06702ef73c7d8629294f8b6386646f888d60979932ba2ee45e3495d8f25006b5",
3 "branchlen": 0,
4 "status": "active"
Header count returned by getblockchaininfo is now < # of blocks.
0# getblockchaininfo
1 "chain": "regtest",
2 "blocks": 1,
3 "headers": 0,