Bitcoin Forum
September 11, 2025, 11:06:12 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Block write to disk  (Read 713 times)
TierNolan (OP)
Legendary
*
Offline Offline

Activity: 1232
Merit: 1144


View Profile
May 10, 2015, 02:14:56 PM
 #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.


1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
goatpig
Moderator
Legendary
*
Offline Offline

Activity: 4004
Merit: 1388

Armory Developer


View Profile
May 10, 2015, 09: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.

TierNolan (OP)
Legendary
*
Offline Offline

Activity: 1232
Merit: 1144


View Profile
May 10, 2015, 09: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.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!