aboutsummaryrefslogtreecommitdiff
path: root/src/util
AgeCommit message (Collapse)Author
2020-01-02Merge #17762: net: Log to net category for exceptions in ProcessMessagesWladimir J. van der Laan
4bdd68f301a9cee3360deafc7531c638e923226b Add missing typeinfo includes (Wladimir J. van der Laan) 4d88c3dcb61e7c075ed3dd442044e0eff4e3c8de net: Log to net category for exceptions in ProcessMessages (Wladimir J. van der Laan) Pull request description: Remove the forest of special exceptions based on string matching, and simply log a short message to the NET logging category when an exception happens during packet processing. It is not good to panick end users with verbose errors (let alone writing to stderr) when any peer can generate them. ACKs for top commit: MarcoFalke: re-ACK 4bdd68f301a9cee3360deafc7531c638e923226b (only change is adding includes) 🕕 promag: ACK 4bdd68f301a9cee3360deafc7531c638e923226b, could squash. Tree-SHA512: a005591a3202b005c75e01dfa54249db3992e2f9eefa8b3d9d435acf66130417716ed926ce4e045179cf43788f1abc7362d999750681a9c80b318373d611c366
2020-01-02Add missing typeinfo includesWladimir J. van der Laan
The use of `typeid()` for logging exception types requires this include according to https://en.cppreference.com/w/cpp/language/typeid.
2019-12-30scripted-diff: Bump copyright of files changed in 2019MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2019-12-20Merge #17473: refactor: Settings code cleanupsMarcoFalke
e9fd366044e271632dc0e4f96e1c14f8e87213ae refactor: Remove null setting check in GetSetting() (Russell Yanofsky) cba2710220d76bbe790b04088839cbbd410436de scripted-diff: Remove unused ArgsManager type flags in tests (Russell Yanofsky) 425bb307252cf4dec9b3ef6426e6548b2be7a303 refactor: Add util_CheckValue test (Russell Yanofsky) 0fa54358b06b58f4d17073bcc8a959eb9498aadc refactor: Add ArgsManager::GetSettingsList method (Russell Yanofsky) 3e185522ace1678e0a25b9cf8a5553a4bc279bea refactor: Get rid of ArgsManagerHelper class (Russell Yanofsky) dc0f1480746b34aa3ca2d9c0f1ec764083026b40 refactor: Replace FlagsOfKnownArg with GetArgFlags (Russell Yanofsky) 57e8b7a7273567aa4a4aee87cce18e9bff8f3196 refactor: Clean up includeconf comments (Russell Yanofsky) 3f7dc9b808316c1e5d677af8d9a99112568c8ccb refactor: Clean up long lines in settings code (Russell Yanofsky) Pull request description: This PR doesn't change behavior. It just implements some suggestions from #15934 and #16545 and few other small cleanups. ACKs for top commit: jnewbery: Code review ACK e9fd366044e271632dc0e4f96e1c14f8e87213ae MarcoFalke: ACK e9fd366044 🚟 Tree-SHA512: 6e100d92c72f72bc39567187ab97a3547b3c06e5fcf1a1b74023358b8bca552124ca6a53c0ab53179b7f1329c03d9a73faaef6d73d2cd1a2321568a0286525e2
2019-12-16util: Move TrimString(...). Introduce default pattern (trims whitespace). ↵practicalswift
Add NODISCARD.
2019-12-16util: Don't allow DecodeBase32(...) of strings with embedded NUL characterspracticalswift
2019-12-16util: Don't allow DecodeBase64(...) of strings with embedded NUL characterspracticalswift
2019-12-16util: Don't allow ParseMoney(...) of strings with embedded NUL characterspracticalswift
2019-12-12util: Don't allow base58-decoding of std::string:s containing non-base58 ↵practicalswift
characters
2019-11-26util: make ScheduleBatchPriority advisory onlyfanquake
2019-11-13refactor: Remove null setting check in GetSetting()Russell Yanofsky
Also rename the "result_complete" variable in GetSettingsList() to "done" to be more consistent with GetSetting(). This change doesn't affect current behavior but could be useful in the future to support dynamically changing settings at runtime and adding new settings sources, because it lets high priority sources reset settings back to default (see test). By removing a special case for null, this change also helps merge code treat settings values more like black boxes, and interfere less with settings parsing and retrieval.
2019-11-13refactor: Add ArgsManager::GetSettingsList methodRussell Yanofsky
Add for consistency with ArgsManager::GetSetting method and to make setting types accessible to ArgsManager callers and tests (test added next commit). This commit does not change behavior.
2019-11-13refactor: Get rid of ArgsManagerHelper classRussell Yanofsky
Suggested by John Newbery <john@johnnewbery.com> https://github.com/bitcoin/bitcoin/pull/15934#issuecomment-551969778 This commit does not change behavior.
2019-11-13refactor: Replace FlagsOfKnownArg with GetArgFlagsRussell Yanofsky
Rename suggested by João Barbosa <joao.paulo.barbosa@gmail.com> https://github.com/bitcoin/bitcoin/pull/16545#issuecomment-519048000 This also gets rid of ArgsManager::NONE constant, which was an implementation detail not meant to be used by ArgsManager callers. Finally this reverts a change from 7f40528cd50fc43ac0bd3e785de24d661adddb7a https://github.com/bitcoin/bitcoin/pull/15934 adding "-" characters to argument names. Better for GetArgFlags to require "-" prefixes for consistency with other ArgsManager methods, and to be more efficient later when GetArg functions need to call GetArgFlags (https://github.com/bitcoin/bitcoin/pull/16545) This commit does not change behavior.
2019-11-13refactor: Clean up includeconf commentsRussell Yanofsky
Suggested by Antoine Riard <ariard@student.42.fr> https://github.com/bitcoin/bitcoin/pull/15934#discussion_r344291875 and John Newbery <john@johnnewbery.com> https://github.com/bitcoin/bitcoin/pull/15934#discussion_r344271224 This commit does not change behavior.
2019-11-13refactor: Clean up long lines in settings codeRussell Yanofsky
Suggested by James O'Beirne <james.obeirne@gmail.com> https://github.com/bitcoin/bitcoin/pull/15934#discussion_r344366743 This commit does not change behavior.
2019-11-12util: Add missing headers to util/fees.cppHennadii Stepanov
2019-11-07Deduplicate settings merge codeRussell Yanofsky
Get rid of settings merging code in util/system.cpp repeated 5 places, inconsistently: - ArgsManagerHelper::GetArg - ArgsManagerHelper::GetNetBoolArg - ArgsManager::GetArgs - ArgsManager::IsArgNegated - ArgsManager::GetUnsuitableSectionOnlyArgs Having settings merging code separated from parsing simplifies parsing somewhat (for example negated values can simply be represented as false values instead of partially cleared or emply placeholder lists). Having settings merge happen one place instead of 5 makes it easier to add new settings sources and harder to introduce new inconsistencies in the way settings are merged. This commit does not change behavior in any way.
2019-11-07Add util::Settings struct and helper functions.Russell Yanofsky
Implement merging of settings from different sources (command line and config file) separately from parsing code in system.cpp, so it is easier to add new sources. Document current inconsistent merging behavior without changing it. This commit only adds new settings code without using it. The next commit calls the new code to replace existing code in system.cpp. Co-authored-by: John Newbery <john@johnnewbery.com>
2019-11-07Remove includeconf nested scopeRussell Yanofsky
Easier to review ignoring whitespace Suggestion from John Newbery <john@johnnewbery.com> in https://github.com/bitcoin/bitcoin/pull/15934#discussion_r343806860
2019-11-07Rename includeconf variables for clarityRussell Yanofsky
includeconf -> conf_file_names to_include -> conf_file_name include_config -> conf_file_stream Suggestion from John Newbery <john@johnnewbery.com> in https://github.com/bitcoin/bitcoin/pull/15934#discussion_r343905138
2019-11-07Clarify emptyIncludeConf logicRussell Yanofsky
Suggestion from John Newbery <john@johnnewbery.com> in https://github.com/bitcoin/bitcoin/pull/15934#discussion_r343795528
2019-11-02Merge #17285: doc: Bip70 removal follow-upWladimir J. van der Laan
3ed8e3d079a3860dcdf944f7c1aa37765a53da32 doc: Remove explicit network name references (Fabian Jahr) d6e493f0c2850b522a676a005935163beddaa2cc wallet: Remove left-over BIP70 comment (Fabian Jahr) Pull request description: A small follow-up to #17165 which removed BIP70 support. 1. Removes one leftover mention of BIP70 in a comment. 2. Removes BIP70 reference in comments on network/chain name strings. These can be removed as they are not really helpful and also incorrect: BIP70 only defines "main" and "test" but not "regtest". If/When signet gets merged we will add another name to the list that is not defined in BIP70. Mostly there is also an exhaustive list of the options included in the comment anyway. If we would like to keep an identifier for this naming scheme, I would suggest switching to something more generic, like 'short chain name'. Happy to implement that if that is preferred. Alternatively, we could add a reference to `CBaseChainParams`. That would also mean we don't have to change these lines again for signet. ACKs for top commit: MarcoFalke: ACK 3ed8e3d079a3860dcdf944f7c1aa37765a53da32 Tree-SHA512: 9a7c0b9cacbb67bd31a089ffdc6f1ebc7f336493e2c8266eb697da34dce2b505a431d5639a3e4fc34f9287361343e861b55dc2662e0a1d2095cc1046db77d6ee
2019-11-01doc: Remove explicit network name referencesFabian Jahr
2019-10-30Merge #15921: validation: Tidy up ValidationState interfaceWladimir J. van der Laan
3004d5a12d09d94bfc4dee2a8e8f2291996a4aaf [validation] Remove fMissingInputs from AcceptToMemoryPool() (John Newbery) c428622a5bb1e37b2e6ab2c52791ac05d9271238 [validation] Remove unused first_invalid parameter from ProcessNewBlockHeaders() (John Newbery) 7204c6434b944f6ad51b3c895837729d3aa56eea [validation] Remove useless ret parameter from Invalid() (John Newbery) 1a37de4b3174d19a6d8691ae07e92b32fdfaef11 [validation] Remove error() calls from Invalid() calls (John Newbery) 067981e49246822421a7bcc720491427e1dba8a3 [validation] Tidy Up ValidationResult class (John Newbery) a27a2957ed9afbe5a96caa5f0f4cbec730d27460 [validation] Add CValidationState subclasses (John Newbery) Pull request description: Carries out some remaining tidy-ups remaining after PR 15141: - split ValidationState into TxValidationState and BlockValidationState (commit from ajtowns) - various minor code style tidy-ups to the ValidationState class - remove the useless `ret` parameter from `ValidationState::Invalid()` - remove the now unused `first_invalid` parameter from `ProcessNewBlockHeaders()` - remove the `fMissingInputs` parameter from `AcceptToMemoryPool()`, and deal with missing inputs the same way as other errors by using the `TxValidationState` object. Tip for reviewers (thanks ryanofsky!): The first commit ("[validation] Add CValidationState subclasses" ) is huge and can be easier to start reviewing if you revert the rote, mechanical changes: Substitute the commit hash of commit "[validation] Add CValidationState subclasses" for <CommitHash> in the commands below. ```sh git checkout <CommitHash> git grep -l ValidationState | xargs sed -i 's/BlockValidationState\|TxValidationState/CValidationState/g' git grep -l ValidationResult | xargs sed -i 's/BlockValidationResult\|TxValidationResult/ValidationInvalidReason/g' git grep -l MaybePunish | xargs sed -i 's/MaybePunishNode\(ForBlock\|ForTx\)/MaybePunishNode/g' git diff HEAD^ ``` After that it's possible to easily see the mechanical changes with: ```sh git log -p -n1 -U0 --word-diff-regex=. <CommitHash> ``` ACKs for top commit: laanwj: ACK 3004d5a12d09d94bfc4dee2a8e8f2291996a4aaf amitiuttarwar: code review ACK 3004d5a12d09d94bfc4dee2a8e8f2291996a4aaf. Also built & ran tests locally. fjahr: Code review ACK 3004d5a12d09d94bfc4dee2a8e8f2291996a4aaf . Only nit style change and pure virtual destructor added since my last review. ryanofsky: Code review ACK 3004d5a12d09d94bfc4dee2a8e8f2291996a4aaf. Just whitespace change and pure virtual destructor added since last review. Tree-SHA512: 511de1fb380a18bec1944ea82b513b6192df632ee08bb16344a2df3c40811a88f3872f04df24bc93a41643c96c48f376a04551840fd804a961490d6c702c3d36
2019-10-30Merge #17280: refactor: Change occurences of c_str() used with size() to data()Wladimir J. van der Laan
f3b51eb9352d7a7c5dfa15615efc8bc0a52ffecf Fix occurences of c_str() used with size() to data() (Wladimir J. van der Laan) Pull request description: Using `data()` better communicates the intent here. ~~Also, depending on how `c_str()` is implemented, this fixes undefined behavior: The part of the string after the first NULL character might have undefined contents (or even be inaccessible, worst case).~~ Apparently [this is no longer an issue with C++11](https://github.com/bitcoin/bitcoin/pull/17281#discussion_r339742128). ACKs for top commit: fjahr: Code review ACK f3b51eb practicalswift: ACK f3b51eb9352d7a7c5dfa15615efc8bc0a52ffecf -- diff looks correct, `data()` more idiomatic ryanofsky: Code review ACK f3b51eb9352d7a7c5dfa15615efc8bc0a52ffecf. Most of these calls (including one in crypter.cpp) are passing text strings, not binary strings likely to contain `\0` and were probably safe before, but much better to avoid the possibility of bugs like this. Tree-SHA512: 842e1bdd37efc4ece2ecb87ca34962aafef0a192180051def630607e349dc9c8b4e562481fff3de474515f493b4ee3ea53b00269a801a66e625326a38dfce5b8
2019-10-29[validation] Add CValidationState subclassesJohn Newbery
Split CValidationState into TxValidationState and BlockValidationState to store validation results for transactions and blocks respectively.
2019-10-29Merge #17260: Split some CWallet functions into new LegacyScriptPubKeyManMarcoFalke
f201ba59ffd2e071a36a688b80d2cff9a9c44bb2 Refactor: Split up CWallet and LegacyScriptPubKeyMan and classes (Andrew Chow) 6702048f91089d7a565e5ca5f7c8dcd2ca405a85 MOVEONLY: Move key handling code out of wallet to keyman file (Andrew Chow) ab053ec6d1e766402f88947d29cd875a285e7280 Move wallet enums to walletutil.h (Andrew Chow) Pull request description: Moves key management functions into a new class LegacyScriptPubKeyMan. First two commits are move-only commits which move stuff out of wallet.{h/cpp} and into newly created scriptpubkeyman.{h/cpp}. Third commit changes several things in CWallet to use LegacyScriptPubKeyMan. First step in the wallet boxes refactor. Note that LegacyScriptPubKeyMan and ScriptPubKeyMan cannot be used standalone yet and are still very much tied into CWallet with both accessing functions within each other. This PR is to help reduce review burden. ACKs for top commit: Sjors: Code review ACK f201ba5. promag: Code review ACK f201ba59ffd2e071a36a688b80d2cff9a9c44bb2. ryanofsky: Code review ACK f201ba59ffd2e071a36a688b80d2cff9a9c44bb2 MarcoFalke: ACK f201ba59ffd2e071a36a688b80d2cff9a9c44bb2 Tree-SHA512: bdc0d8595a06233fe003afcf968a38e0e8cc584a6a89c5bcd05309ac29dca852391802d46763ef81a108d146d0f40c79ea5438e87234ed12b4b8360c9aec94c0
2019-10-28Merge #17279: refactor: Remove redundant c_str() calls in formattingMarcoFalke
c72906dcc11a73fa06a0adf97557fa756b551bee refactor: Remove redundant c_str() calls in formatting (Wladimir J. van der Laan) Pull request description: Our formatter, tinyformat, *never* needs `c_str()` for strings. Still, many places call it redundantly, resulting in longer code and a slight overhead. Remove redundant `c_str()` calls for: - `strprintf` - `LogPrintf` - `tfm::format` (also, combined with #17095, I think this improves logging in case of unexpected embedded NULL characters) ACKs for top commit: ryanofsky: Code review ACK c72906dcc11a73fa06a0adf97557fa756b551bee. Easy to review with `git log -p -n1 --word-diff-regex=. -U0 c72906dcc11a73fa06a0adf97557fa756b551bee` Tree-SHA512: 9e21e7bed8aaff59b8b8aa11571396ddc265fb29608c2545b1fcdbbb36d65b37eb361db6688dd36035eab0c110f8de255375cfda50df3d9d7708bc092f67fefc
2019-10-28Merge #17266: util: Rename DecodeDumpTime to ParseISO8601DateTimeMarcoFalke
e7b02b54ccfb6b2e119a67799220f8d8d8b5cccd Add roundtrip and more tests to ParseISO8601DateTime and FormatISO8601DateTime (Elichai Turkel) 9e2c623be50ee7e586a411923b9ed136acfa2b3f Rename DecodeDumpTime to ParseISO8601DateTime and move to time.cpp (Elichai Turkel) Pull request description: As discussed in #17245. 1. Renamed the function. 2. Moved it from `rpcdump.cpp` to `time.cpp`. 3. Added a check if the time is less then epoch return 0 to prevent an overflow. 4. Added more edge cases tests and a roundtrip test. ACKs for top commit: laanwj: ACK e7b02b54ccfb6b2e119a67799220f8d8d8b5cccd MarcoFalke: ACK e7b02b54ccfb6b2e119a67799220f8d8d8b5cccd promag: Code review ACK e7b02b54ccfb6b2e119a67799220f8d8d8b5cccd. Moved code is correct, left a comment regarding the test change. Tree-SHA512: 703c21e09b2aabc992235149e67acba63d9d77a593ec8f6d2fec3eb63a7e5c406d56cbce6c6513ab32fba43367d073d2345f3b589843e3c5fe4f55ea3e00bf29
2019-10-28Fix occurences of c_str() used with size() to data()Wladimir J. van der Laan
Using `data()` better communicates the intent here. Also, depending on how `c_str()` is implemented, this fixes undefined behavior: The part of the string after the first NULL character might have undefined contents.
2019-10-28refactor: Remove redundant c_str() calls in formattingWladimir J. van der Laan
Our formatter, tinyformat, *never* needs `c_str()` for strings. Remove redundant `c_str()` calls for: - `strprintf` - `LogPrintf` - `tfm::format`
2019-10-28Merge #17192: util: Add CHECK_NONFATAL and use it in src/rpcWladimir J. van der Laan
faeb6665362e35f573ad715ade0ef2db62d71839 util: Add CHECK_NONFATAL and use it in src/rpc (MarcoFalke) Pull request description: Fixes #17181 Currently, we use `assert` in RPC code to document logic and code assumptions. However, it seems a bit extreme to abort all of Bitcoin Core on an assert failure in one of the RPC threads. I suggest to replace all `assert`s with a macro `CHECK_NONFATAL(condition)` that throws a runtime error when the condition evaluates to `false`. That runtime error will then be returned to the rpc caller and will include instructions to report the error to our issue tracker. ACKs for top commit: practicalswift: ACK faeb6665362e35f573ad715ade0ef2db62d71839 laanwj: ACK faeb6665362e35f573ad715ade0ef2db62d71839 ryanofsky: Code review ACK faeb6665362e35f573ad715ade0ef2db62d71839 Tree-SHA512: 9b748715a5e0767ac11f1324a95a3a6ec672a0e0658013492219223bda83ce4b1b447fd8183bbb235f7df5ef7dddda7666ad569544b4d61cc65f232ca7a800ec
2019-10-27Rename DecodeDumpTime to ParseISO8601DateTime and move to time.cppElichai Turkel
2019-10-25MOVEONLY: Move key handling code out of wallet to keyman fileAndrew Chow
Start moving wallet and ismine code to scriptpubkeyman.h, scriptpubkeyman.cpp The easiest way to review this commit is to run: git log -p -n1 --color-moved=dimmed_zebra And check that everything is a move (other than includes and copyrights comments). This commit is move-only and doesn't change code or affect behavior.
2019-10-24Merge #17004: validation: Remove REJECT code from CValidationStateWladimir J. van der Laan
9075d13153ce06cd59a45644831ecc43126e1e82 [docs] Add release notes for removal of REJECT reasons (John Newbery) 04a2f326ec0f06fb4fce1c4f93500752f05dede8 [validation] Fix REJECT message comments (John Newbery) e9d5a59e34ff2d538d8f5315efd9908bf24d0fdc [validation] Remove REJECT code from CValidationState (John Newbery) 0053e16714323c1694c834fdca74f064a1a33529 [logging] Don't log REJECT code when transaction is rejected (John Newbery) a1a07cfe99fc8cee30ba5976dc36b47b1f6532ab [validation] Fix peer punishment for bad blocks (John Newbery) Pull request description: We no longer send BIP 61 REJECT messages, so there's no need to set a REJECT code in the CValidationState object. Note that there is a minor bug fix in p2p behaviour here. Because the call to `MaybePunishNode()` in `PeerLogicValidation::BlockChecked()` only previously happened if the REJECT code was > 0 and < `REJECT_INTERNAL`, then there are cases were `MaybePunishNode()` can get called where it wasn't previously: - when `AcceptBlockHeader()` fails with `CACHED_INVALID`. - when `AcceptBlockHeader()` fails with `BLOCK_MISSING_PREV`. Note that `BlockChecked()` cannot fail with an 'internal' reject code. The only internal reject code was `REJECT_HIGHFEE`, which was only set in ATMP. This reverts a minor bug introduced in 5d08c9c579ba8cc7b684105c6a08263992b08d52. ACKs for top commit: ariard: ACK 9075d13, changes since last reviewed are splitting them in separate commits to ease understanding and fix nits fjahr: ACK 9075d13153ce06cd59a45644831ecc43126e1e82, confirmed diff to last review was fixing nits in docs/comments. ryanofsky: Code review ACK 9075d13153ce06cd59a45644831ecc43126e1e82. Only changes since last review are splitting the main commit and updating comments Tree-SHA512: 58e8a1a4d4e6f156da5d29fb6ad6a62fc9c594bbfc6432b3252e962d0e9e10149bf3035185dc5320c46c09f3e49662bc2973ec759679c0f3412232087cb8a3a7
2019-10-18Merge #17184: util: Filter out macOS process serial numberfanquake
b5f0be38790ecc87a1e537edeca5923f608bc68c util: Filter out macOS process serial number (Hennadii Stepanov) Pull request description: Fix #17179 ACKs for top commit: laanwj: ACK b5f0be38790ecc87a1e537edeca5923f608bc68c MarcoFalke: unsigned ACK b5f0be38790ecc87a1e537edeca5923f608bc68c promag: ACK b5f0be38790ecc87a1e537edeca5923f608bc68c. fanquake: ACK b5f0be38790ecc87a1e537edeca5923f608bc68c - Tested that this fixes #17179. Tree-SHA512: 84ce859e53ebc7ad2d0a45e954243ef6efee640f1e0212322f68a317e4361a216ecb4b5a3a410ab31613adc285c8d3840fbf41fa9da9019be3d734db6b9427cd
2019-10-18util: Add CHECK_NONFATAL and use it in src/rpcMarcoFalke
2019-10-18Merge #16889: Add some general std::vector utility functionsMarcoFalke
7d8d3e6a2ad827fa916e3909a18dedb9f7fdce43 Add tests for util/vector.h's Cat and Vector (Pieter Wuille) e65e61c812df90a56e3ce4a8e76c4b746766f387 Add some general std::vector utility functions (Pieter Wuille) Pull request description: This is another general improvement extracted from #16800 . Two functions are added are: * Vector(arg1,arg2,arg3,...) constructs a vector with the specified arguments as elements. The vector's type is derived from the arguments. If some of the arguments are rvalue references, they will be moved into place rather than copied (which can't be achieved using list initialization). * Cat(vector1,vector2) returns a concatenation of the two vectors, efficiently moving elements when relevant. Vector generalizes (and replaces) the `Singleton` function in src/descriptor.cpp, and `Cat` replaces the function in bech32.cpp ACKs for top commit: laanwj: ACK 7d8d3e6a2ad827fa916e3909a18dedb9f7fdce43 MarcoFalke: ACK 7d8d3e6a2ad827fa916e3909a18dedb9f7fdce43 (enjoyed reading the tests, but did not compile) Tree-SHA512: 92325f14e90d7e7d9d920421979aec22bb0d730e0291362b4326cccc76f9c2d865bec33a797c5c0201773468c3773cb50ce52c8eee4c1ec1a4d10db5cf2b9d2a
2019-10-18util: Filter out macOS process serial numberHennadii Stepanov
2019-10-16Add some general std::vector utility functionsPieter Wuille
Added are: * Vector(arg1,arg2,arg3,...) constructs a vector with the specified arguments as elements. The vector's type is derived from the arguments. If some of the arguments are rvalue references, they will be moved into place rather than copied (which can't be achieved using list initialization). * Cat(vector1,vector2) returns a concatenation of the two vectors, efficiently moving elements when relevant. Vector generalizes (and replaces) the Singleton function in src/descriptor.cpp, and Cat replaces the Cat function in bech32.cpp
2019-10-15Remove unused includespracticalswift
2019-10-10Merge #16887: Abstract out some of the descriptor Span-parsing helpersMarcoFalke
bb36372b8f2bd675313ae8553ceb61f28c2c1afd test: add unit tests for Span-parsing helpers (Sebastian Falbesoner) 5e69aeec3f2a0fafd5e591b7222716f00145761d Add documenting comments to spanparsing.h (Pieter Wuille) 230d43fdbc41b356700b0d8a6984d69e00279ade Abstract out some of the descriptor Span-parsing helpers (Pieter Wuille) Pull request description: As suggested here: https://github.com/bitcoin/bitcoin/pull/16800#issuecomment-531605482. This moves the Span parsing functions out of the descriptor module, making them more easily usable for other parsers (in particular, in preparation for miniscript parsing). ACKs for top commit: MarcoFalke: ACK bb36372b8f2bd675313ae8553ceb61f28c2c1afd Tree-SHA512: b5c5c11a9bc3f0a1c2c4cfa22755654ecfb8d4b69da0dc1fb9f04e1556dc0f6ffd87ad153600963279ac465d587d7971b53d240ced802d12693682411ac73deb
2019-10-10[logging] Don't log REJECT code when transaction is rejectedJohn Newbery
Remove the BIP61 REJECT code from error messages and logs when a transaction is rejected. BIP61 support was removed from Bitcoin Core in fa25f43ac5692082dba3f90456c501eb08f1b75c. The REJECT codes will be removed from the codebase entirely in the following commit.
2019-10-09init: Change fallback locale to C.UTF-8Wladimir J. van der Laan
Much of our code assumes UTF-8 support, and this is a more realistic guess for modern systems anyway than the default character set (which would be ASCII only). So change the assumed fallback locale (if no locale is defined by the user or OS) to `C.UTF-8`.
2019-10-08Merge #17073: move-only: PASTE macros to util/macros.hWladimir J. van der Laan
0d86f4d3dacab38f3cd5371d0c920585c178302c refactor: consolidate PASTE macros (James O'Beirne) Pull request description: Really dumb move-only stolen from #16805. Some of my pull requests also depend on this, so I split it up to not depend on #16805. ACKs for top commit: practicalswift: ACK 0d86f4d3dacab38f3cd5371d0c920585c178302c -- diff looks correct hebasto: ACK 0d86f4d3dacab38f3cd5371d0c920585c178302c, I have reviewed the code and it looks OK, I agree it can be merged. promag: ACK 0d86f4d3dacab38f3cd5371d0c920585c178302c. Tree-SHA512: 19208a8cbf83034b1ef25138d8f08d8f32ace7775f654b1597fc4599dd576f0758145f592f161cfdcaaa29d4907ac9aa5553f6f524e2b960205c760605a05901
2019-10-03Don't rename main thread at process levelWladimir J. van der Laan
Set only the internal name. Fixes #17036 for both `bitcoind` and `bitcoin-qt`.
2019-10-02Merge #16908: txmempool: Make entry time type-safe (std::chrono)Wladimir J. van der Laan
faec689bed7a5b66e2a7675853d10205b933cec8 txmempool: Make entry time type-safe (std::chrono) (MarcoFalke) faaa1f01daba94b021ca77515266a16d27f0364e util: Add count_seconds time helper (MarcoFalke) 1111170f2f0141084b5b4ed565b2f07eba48599a test: mempool entry time is persisted (MarcoFalke) Pull request description: This changes the type of the entry time of txs into the mempool from `int64_t` to `std::chrono::seconds`. The benefits: * Documents the type for developers * Type violations result in compile errors * After compilation, the two are equivalent (at no run time cost) ACKs for top commit: ajtowns: utACK faec689bed7a5b66e2a7675853d10205b933cec8 laanwj: ACK faec689bed7a5b66e2a7675853d10205b933cec8 Tree-SHA512: d958e058755d1a1d54cef536a8b30a11cc502b7df0d6ecf84a0ab1d38bc8105a67668a99cd5087a444f6de2421238111c5fca133cdf8e2e2273cb12cb6957845
2019-09-30util: Make thread names shorterHennadii Stepanov
Thread names at the process level are limited by 15 characters. This commit ensures that name 'b-httpworker.42' will not be cropped.
2019-09-25refactor: consolidate PASTE macrosJames O'Beirne