-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Constrain constant values to a single location in code #6349
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
Conversation
|
No wallet build fails with: CXX libbitcoin_server_a-init.o |
|
concept ACK.
|
|
concept ACK |
|
@jgarzik I put it in rpcserver.h because the -rest option is used in rpcserver.cpp, which handles all HTTP requests. There is no rest.h - do you really want me to make one just for this? |
|
@paveljanik Fixed. |
src/main.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you call this TXINDEX_DEFAULT instead of DEFAULT_TXINDEX?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno, changed for consistency.
src/util.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declaring the constant and its value in a header won't work well for data structures that require a larger amount of memory or indirected pointers, such as strings, structs, objects etc. In worst case this causes errors in some compilers, in best case this causes unnecessary memory use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So please move the content of the variable and BITCOIN_PID_FILENAME to util.cpp
Apart from that I'd like to merge this
|
Concept ACK |
|
Needs rebase + string nit addresed |
|
concept ACK |
|
concept ACK - as @laanwj says it appears merge-ready once rebased + nits addressed |
…database, not memory pool)
…t; also show correct default in getmininginfo
…as compiled on Also hides the option for non-GUI builds.
|
Rebased, addressed nit, added equivalent commit for -uiplatform. (Travis passes.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should use uiInterface here, nor put this uiplatform id as a variable on the UI interface (as bitcoind has no business with it). I'd just check for mode == HMM_BITCOIN_QT, like for the other options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I understand now, you want to show the actual default here. Ok then it makes sense.
We should never have moved the UI-specific options back to init, but that's not your fault.
|
utACK, however I didn't cross verify the constants. |
|
utACK 29266b6. |
|
Does this need more reviewers or can it be merged as is? (Any further merge conflicts would only retrigger review, so let's try to finish with this PR.) |
|
Needs rebase (caused by #6235) |
|
Fixed by #6961. |
No description provided.