• Calin Culianu's avatar
    Refactor `DEFAULT_MAX_GENERATED_BLOCK_SIZE` into chain-specific defaults · 7628469b
    Calin Culianu authored
    We would like to be able to provide chain-specific default mined block
    sizes. This will allow us to fine-tune the defaults that BCHN ships with
    to be specific to each chain. Motivation: What is a good default for
    ScaleNet or RegTest doesn't necessarily work as a global default for
    This commit removes the global constant `DEFAULT_MAX_GENERATED_BLOCK_SIZE`
    since its existence now could potentially be a source of confusion and
    bugs.  The default mined block size now is a chain-specific setting that
    lives in `Consensus::Params` and is set-up in `chainparams.cpp` for each
    of the 5 chains we support.
    Moreover, the `Config` object manages the user setting as specified in
    config file or CLI.  Two new methods were added to the `Config` object to
    get/set the `GeneratedMaxBlockSize`.
    As such, we got rid of checking the `gArgs` object for `-blockmaxsize`
    during critical paths, since that is just wasted CPU cycles (the ob...
policy.h 6.15 KB