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

test: add functional test for -maxtipage parameter #24154

Merged
merged 1 commit into from Jan 26, 2022

Conversation

theStack
Copy link
Contributor

This PR adds a missing test for the -maxtipage parameter which controls what is the allowed maximum tip age for leaving IBD:

argsman.AddArg("-maxtipage=<n>", strprintf("Maximum tip age in seconds to consider node in initial block download (default: %u)", DEFAULT_MAX_TIP_AGE), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);

Relevant code path in the CChainState::IsInitialBlockDownload method:

bitcoin/src/validation.cpp

Lines 1479 to 1480 in 792d0d8

if (m_chain.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge))
return true;

The test is pretty simple and should be self-explanatory.

@laanwj
Copy link
Member

laanwj commented Jan 25, 2022

Concept ACK, thanks for adding a test for this.

@laanwj laanwj added the Tests label Jan 25, 2022
@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #24149 (Signing support for Miniscript Descriptors by darosior)
  • #24148 (Miniscript support in Output Descriptors by darosior)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko
Copy link
Member

maflcko commented Jan 26, 2022

review ACK 75656ad

@maflcko maflcko merged commit dd405ad into bitcoin:master Jan 26, 2022
@theStack theStack deleted the 202201-test-add_maxtipage_test branch January 26, 2022 11:03
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 28, 2022
…eter

75656ad test: add functional test for `-maxtipage` parameter (Sebastian Falbesoner)

Pull request description:

  This PR adds a missing test for the `-maxtipage` parameter which controls what is the allowed maximum tip age for leaving IBD:
  https://github.com/bitcoin/bitcoin/blob/792d0d8d512cf8ddca200317b74ce550c1a1a428/src/init.cpp#L540

  Relevant code path in the `CChainState::IsInitialBlockDownload` method:
  https://github.com/bitcoin/bitcoin/blob/792d0d8d512cf8ddca200317b74ce550c1a1a428/src/validation.cpp#L1479-L1480

  The test is pretty simple and should be self-explanatory.

ACKs for top commit:
  MarcoFalke:
    review ACK 75656ad

Tree-SHA512: 0a10dca13cb18c29e64fc8412f4c8f2bcaff1bab8645bd85266c242ba88ce036a150c03cbbe9810c3bb44649810af0aa9cb3584dbae886a7bdb16b72150d08de
@bitcoin bitcoin locked and limited conversation to collaborators Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants