Author

Topic: Block write to disk (Read 694 times)

legendary
Activity: 1232
Merit: 1094
May 10, 2015, 04:38:25 PM
#3
the only way this could throw off Armory is if Core were to maintain an invalid fork that is stronger than the main valid branch.

Fair enough.  The disk records are only assumed to correct, if they are on the main chain and that is fully checked.
legendary
Activity: 3738
Merit: 1360
Armory Developer
May 10, 2015, 04:00:41 PM
#2
We build the longest chain based on headers and verify the block data hashes to what the respective header carries. We ultimately trust Core is serving us valid blocks. While Core does write invalid blocks time to time, the only way this could throw off Armory is if Core were to maintain an invalid fork that is stronger than the main valid branch.

I think at this point the network as a whole would have bigger issues to deal with than Armory displaying data from an huge invalid fork.
legendary
Activity: 1232
Merit: 1094
May 10, 2015, 09:14:56 AM
#1
I was looking through main.cpp and it looks like bitcoin core writes unverified blocks to disk.  Does Armory assume that the blk???.dat files are verified?

The TestBlockValidity() function goes through the following steps.

CheckBlock -> does basic checks
AcceptBlock -> writes block to disk
ActivateBestChain calls ActivateBestChainStep call ConnectTip calls ConnectBlock -> verifies the scripts

This means that blocks which meet all the basic rules (POW, hashes, size limits etc.) are written to disk even if the scripts fail.

Jump to: