```
cmake .. -GNinja -DBUILD_BITCOIN_CHAINSTATE=ON
ninja
```
Running the new executable and pasting some hex blocks (the ones just after the tip from our chainstate)
```
$ src/bitcoin-chainstate /data/ecashd
Hello! I'm going to print out some information about your datadir.
Path: "/data/ecashd"
Reindexing: false
Snapshot Active: false
Active Height: 823235
Active IBD: true
CBlockIndex(pprev=0x7fe1085ce0c8, nHeight=823235, merkle=6a3a479d92db7c5a178356c680a58ff0468ed2aaf689c850b55729ebb0038568, hashBlock=0000000000000000085542cbdfd82a970117d737ebe8bc7a5c04d78d80d7bce9)
00e01420e9bcd7808dd7045c7abce8eb37d71701972ad8dfcb42550800000000000000005b31c63b1d34d740df4dea822a57439cdcf9c34b7a07a47c65c7602b78e81978ec388165c5102f18b4e7455f0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5803c48f0c04ed3881650cfabe6d6db68846e753ced995dcfb5a40b17108c8aceee4f11bb86c48c31000d62cd8859b10000000000000002ffffbec16c3eb3e20000000153237616661356365343565313830636333343636380000000003a04f9b15000000001976a914ce8c8cf69a922a607e8e03e27ec014fbc24882e088ac00c2eb0b0000000017a914d37c4c809fe9840e7bfa77b86bd47163f6fb6c6087a0acb903000000001976a914c36941af4c8cdf6e3156f7fe1426d05d6177890e88ac00000000
Valid
initial value. Block has not yet been rejected
0040382de2bda14474f926af7d0e202cb5cd4583b978fd58c42d4c1600000000000000008addc8d8119c2d3d4943b06d7e532aca3dc146aa563e72f347f34bf0a37a1d5a0639816500f52e18360673500101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5803c58f0c04063981650cfabe6d6d3b4767d5cada5b02046d6405e06e30e589b2bdf8de43e1517b8bf59ff31aca1f10000000000000002ffffc3b38f5cc2904000000153237616661356365343565313830636333343637310000000003a04f9b15000000001976a914ce8c8cf69a922a607e8e03e27ec014fbc24882e088ac00c2eb0b0000000017a914d37c4c809fe9840e7bfa77b86bd47163f6fb6c6087a0acb903000000001976a914600fe1afb15029166355501cb7887426b0055ca188ac00000000
Valid
initial value. Block has not yet been rejected
00004020da54eb3fb73d3189ed4ce5e271254c3b1fe0005b2d5a9e000000000000000000d66ac17f80b5e9d3ea82c30d266ae6ff333a2456d94937928ae92478205eaa1ef7398165b5bc2e187205635d0601000000010000000000000000000000000000000000000000000000000000000000000000ffffffff2f03c78f0c192f5669614254432f4d696e656420627920303931353137342f10380fa10ffd4bebde9c19aac3c65e0000ffffffff0360569b15000000001976a914f1c075a01882ae0972f95d3a4177c86c852b7d9188acb8c5eb0b0000000017a914d37c4c809fe9840e7bfa77b86bd47163f6fb6c6087c9adb903000000001976a9143b3eb65690dec80b315e8c3fd6fd0232c38c59d288ac0000000002000000024c1fbb7ce9bbc4555e8c15621619ca90da3ddf0043ac10dc18131bc7924fc98f010000006a473044022078ebd457011f21443762e0c2837baa66c6d4107a1c052f9e9abcaf9c001f782402201a6aef58c2c93073f56d3fe93f08444f153ebb8797b19e7c9e3bb74f6a77dfe341210393b8e2edaba37f38df59d9683496b8ba5308daa8b4379c9eb0bf3032ec902443feffffffa36c19a87b374d87a87d38d311888d5632d14100ea67b673a754fd485643c5a5010000006a4730440220357c724222af9451e568553c85b15e69fc4f7920c39021136ca0a2a7bacfab9f02204e5e00067b262193916160fcd5d8a35fff17cb96948ef1fc856429b9d09adf43412102323932bb9a0d3831f4128d7cfa3b64bced5942f2e166ca42c7053e4e55303d83feffffff0218a21e00000000001976a91498078594b2bd6c81c646e05c77ba7c6591b063ae88acf80e0403000000001976a9143f3195bbb577975e6190a8dd8fc5f8ed406918e188ac000000000200000001a998d67f952c0f464b7e18b3b925d6e1dccf3b608da250122362462b36abb6f00e0000006b483045022100c08842226a49bd6cda3030b3c614af326d55d8e729444854f39cb7268f39f68e02202f4e558da41154b8c2af71728d5345f20a63808f79497def36fe9cce99851ccc4121031238ccc7f1d6a7a6f4b5c4308113bb696cc189881a5191fd130fc44ec4d628dcffffffff01453a0000000000001976a9145c60a0e3914b4b12a419db5be6f742754e85971688ac0000000002000000014dd11d5dc696f6e50af5c65d796791845cdd721594dc4ef615831033327e7ce2010000006b483045022100c343ed45f604950c9f062c5b7071fc0f4118b5ab6e88dcd479cba3c31da0e84d02200ce13ee10074b20590eac22cf9f9e053d833b5d57b080af7c021a3a8fe80976f4121027388cc87347171e7dbd714ce6a06e74235b181a7e4e0700042cf0546d7717d7effffffff022c330000000000001976a914370f10a3ccd0b6abd6e31b60459f099b2ca8c0b588ace7976b04000000001976a914a46b94c091f0569a61a00a48e16beafbd4084b8f88ac0000000002000000021b31890ce286a5ea98b4779dee70f1a2274c0e228bc5828f399908849a982fca030000006a473044022000efb6dbb88c7c42bfc1d652818d8b085ac7cc5ae3ba30cd94a280111003f7fa022015dbfab1710b488c464608c2bcf49ced5d61674917e9cdd7d156853cfc28f8444121021a30651b9f40b72c86c58c11bac28a435409d01b75b27c9ed4477c49bdd83d7dffffffff35b0726e51f8a1f4139f8b3d980159e8b268ac7f3768cf712e33080462efc08c020000006b483045022100ec913466f771559d3c449132545f4c3c3b22564e86425fa4c6a7d58133c3e1e302202037338f145e650a43840be8e1e6838f9d77969df8a7941ee6bddf30626253534121021a30651b9f40b72c86c58c11bac28a435409d01b75b27c9ed4477c49bdd83d7dffffffff040000000000000000406a04534c500001010453454e4420fb4233e8a568993976ed38a81c2671587c5ad09552dedefa78760deed6ff87aa080000000001312d00080000000b6a62090622020000000000001976a914370f10a3ccd0b6abd6e31b60459f099b2ca8c0b588ac22020000000000001976a9140d6dc2de063349b7176ce232461190ff7bcb14de88acb70d4600000000001976a9140d6dc2de063349b7176ce232461190ff7bcb14de88ac0000000002000000011f3d885adffff2268fa66e61c4d0ab2d5f2e548d5ab82f7f68530524f6381909010000006b483045022100f6b93e125a046e76265d4820d0c35d6431cffca22d67e29acee6b9afd0ecc4f9022057130ee32aae56b2e83525b6048c1da42f1bdb608069c0e6d4ca48348d40ec654121027388cc87347171e7dbd714ce6a06e74235b181a7e4e0700042cf0546d7717d7effffffff022c330000000000001976a9142ebcb15d8ccd04d2fdb45ed30b8329bd6067784688ac3acd6b04000000001976a914a46b94c091f0569a61a00a48e16beafbd4084b8f88ac00000000
inconclusive
```
Re-running `bitcoin-chainstate`, note that the active tip has advanced by two blocks, then pasting an old block (duplicate)
```
$ src/bitcoin-chainstate /data/ecashd
Hello! I'm going to print out some information about your datadir.
Path: "/data/ecashd"
Reindexing: false
Snapshot Active: false
Active Height: 823237
Active IBD: true
CBlockIndex(pprev=0x7fdb16e3b0c8, nHeight=823237, merkle=5a1d7aa3f04bf347f3723e56aa46c13dca2a537e6db043493d2d9c11d8c8dd8a, hashBlock=00000000000000000571463c80aa2dd411dbb5733c84e80b13ab329066918a84)
00c0012014b97d29661368d02d2593437c6cfbced254bc93daebea1f0000000000000000d53f666733a961c0f6d54a17c6c1a0de50b8687873aeacb0c12590711b89145bb52f816547f72e18c649a0890101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5803c18f0c04b62f81650cfabe6d6dc0d0d8c1dda463e1b906bfd1df887f20647ce66b7bf71fcda76fe1a7a5a8b4b110000000000000005ffffd71c7682a7fc8000000156536303266303261396362393865623833343836380000000003a04f9b15000000001976a914ce8c8cf69a922a607e8e03e27ec014fbc24882e088ac00c2eb0b0000000017a914d37c4c809fe9840e7bfa77b86bd47163f6fb6c6087a0acb903000000001976a914798038c8969512b74e82124a9a7364192893237188ac00000000
duplicate
```