Skip to content

test: add functional test for -maxtipage parameter#24154

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
theStack:202201-test-add_maxtipage_test
Jan 26, 2022
Merged

test: add functional test for -maxtipage parameter#24154
maflcko merged 1 commit into
bitcoin:masterfrom
theStack:202201-test-add_maxtipage_test

Conversation

@theStack

Copy link
Copy Markdown
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

laanwj commented Jan 25, 2022

Copy link
Copy Markdown
Member

Concept ACK, thanks for adding a test for this.

@laanwj laanwj added the Tests label Jan 25, 2022
@DrahtBot

Copy link
Copy Markdown
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

maflcko commented Jan 26, 2022

Copy link
Copy Markdown
Member

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
@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.

4 participants