Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blockchain: Add ReconsiderBlock() #2196

Merged
merged 2 commits into from
Jun 19, 2024
Merged

Commits on Jun 7, 2024

  1. blockchain: Refactor reorganizeChain to exclude verification

    reorganizeChain() used to handle the following:
    1: That the blocknodes being disconnected/connected indeed to connect
       properly without errors.
    2: Perform the actual disconnect/connect of the blocknodes.
    
    The functionality of 1, the validation that the disconnects/connects can
    happen without errors are now refactored out into
    verifyReorganizationValidity.
    
    This is an effort made so that ReconsiderBlock() can call
    verifyReorganizationValidity and set the block status of the
    reconsidered chain and return nil even when an error returns as it's ok
    to get an error when reconsidering an invalid branch.
    kcalvinalvin authored and Crypt-iQ committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    eabc9bf View commit details
    Browse the repository at this point in the history
  2. blockchain: Add ReconsiderBlock to BlockChain

    ReconsiderBlock reconsiders the validity of the block for the passed
    in blockhash. The behavior of the function mimics that of Bitcoin Core.
    
    The invalid status of the block nodes are reset and if the chaintip that
    is being reconsidered has more cumulative work, then we'll validate the
    blocks and reorganize to it. If the cumulative work is lesser than the
    current active chain tip, then nothing else will be done.
    kcalvinalvin authored and Crypt-iQ committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    52a8a2a View commit details
    Browse the repository at this point in the history