Skip to content

Conversation

@fjahr
Copy link
Contributor

@fjahr fjahr commented Oct 14, 2025

Note: There is an alternative change that turns -asmap into a bool option and adds a -asmapfile option: #33631 Please indicate with your conceptual review which option you prefer, thanks!

This changes the behavior of the GetPathArg function to better work with the behavior of -asmap. When a path arg is given "1" (for example -asmap=1), this would currently be interpreted as a path but should be interpreted as using the arg without a parameter which activates the fallback. There is no explicit test added here because this is tested implicitly in the tests added in #28792.

Also improves the documentation of the -asmap default behavior.

See #33386 for further discussion. Closes #33386

Otherwise -asmap=1, for example, would be interpreted as a path "1".
@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 14, 2025

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

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33632.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #33631 (init: Split file path handling out of -asmap option by fjahr)
  • #31260 (scripted-diff: Type-safe settings retrieval by ryanofsky)
  • #28792 (Embed default ASMap as binary dump header file by fjahr)
  • #17783 (common: Disallow calling IsArgSet() on ALLOW_LIST options by ryanofsky)
  • #17581 (refactor: Remove settings merge reverse precedence code by ryanofsky)
  • #17580 (refactor: Add ALLOW_LIST flags and enforce usage in CheckArgFlags by ryanofsky)
  • #17493 (util: Forbid ambiguous multiple assignments in config file by ryanofsky)

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.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit from the llm bot)

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
@ryanofsky
Copy link
Contributor

I think this is ok to close, since my suggestion about improving the default behavior #33631 (comment) as a better alternative to that PR also seems like it could be a better alternative to this PR.

I do think the approach in the PR is reasonable, though. It could also be implemented by calling InterpretBool("-asmap", false) to detect the "1" value instead of hardcoding it into GetPathArg and affecting other users of GetPathArg which may not want to treat "1" specially.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default ASmap file path is not used unless -asmap is set

4 participants