bitcoin源码分析 – 区块操作

Block — 操作

区块产生

ProcessNewBlock

区块网络消息

区块回滚

(1) init: ReplayBlocks

(2) ActivateBestChain()

ActivateBestChain()
    ActivateBestChainStep()
        chainActive.FindFork
        // Disconnect active blocks which are no longer in the best chain.
        DisconnectTip
            DisconnectBlock
                UndoReadFromDisk
        // Build list of new blocks to connect.
        ConnectTip
            ConnectBlock
                WriteUndoDataForBlock

                孤立块保留多长时间?
                setBlockIndexCandidates

区块序列化

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.