aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-util.cpp
AgeCommit message (Collapse)Author
2023-11-16Include version.h in fewer placesAnthony Towns
2023-09-12[refactor] Add missing includes for next commitTheCharlatan
2023-05-20refactor: Move system from util to common libraryTheCharlatan
Since the kernel library no longer depends on the system file, move it to the common library instead in accordance to the diagram in doc/design/libraries.md.
2023-05-09refactor: Replace string chain name constants with ChainTypesTheCharlatan
This commit effectively moves the definition of these constants out of the chainparamsbase to their own file. Using the ChainType enums provides better type safety compared to passing around strings. The commit is part of an ongoing effort to decouple the libbitcoinkernel library from the ArgsManager and other functionality that should not be part of the kernel library.
2023-04-19move-only: Extract common/args and common/config.cpp from util/systemTheCharlatan
This is an extraction of ArgsManager related functions from util/system into their own common file. Config file related functions are moved to common/config.cpp. The background of this commit is an ongoing effort to decouple the libbitcoinkernel library from the ArgsManager. The ArgsManager belongs into the common library, since the kernel library should not depend on it. See doc/design/libraries.md for more information on this rationale.
2023-03-26clang-tidy: Add `performance-inefficient-vector-operation` checkHennadii Stepanov
https://clang.llvm.org/extra/clang-tidy/checks/performance/inefficient-vector-operation.html
2023-03-13refactor: Extract util/exception from util/systemBen Woosley
This is a minimal extraction of a single function, but also the only use of std::exception in util/system. The background of this commit is an ongoing effort to decouple the libbitcoinkernel library from the ArgsManager defined in system.h. Moving the function out of system.h allows including it from a separate source file without including the ArgsManager definitions from system.h.
2023-01-26Use DataStream where possibleMarcoFalke
2022-12-24scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: - 2021: f47dda2c58b5d8d623e0e7ff4e74bc352dfa83d7 - 2020: fa0074e2d82928016a43ca408717154a1c70a4db - 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2022-12-16Make bitcoin-util grind_task tsan friendlyMacroFake
This does not change behavior of the bitcoin-util binary.
2022-07-20refactor: move compat.h into compat/fanquake
2022-06-11compat: Consolidate mingw-w64 ASLR workaround for upstream libsecp changesfanquake
Achieve this by adding a MAIN_FUNCTION macro, consolidating the docs, and introducing the macro across our distributed binaries. Also update the docs to explain that anyone using binutils < 2.36 is effected by this issue. Release builds are not, because they use binutils 2.37. Currently LTS Linux distros, like Ubuntu Focal, ship with 2.34. https://packages.ubuntu.com/focal/binutils
2022-05-30Remove no-op TIME_INIT on deserMarcoFalke
Assigning TIME_INIT to nTime was needed to fully re-initialize a dirty object where the deserialization might skip nTime. See https://github.com/bitcoin/bitcoin/pull/19020/files#r427620111 Now that the without-nTime logic is removed in commit dbcb5742c48fd26f77e500291d7083e12eec741b and commit e08770bed187bfa66f525d42e484579bcea78bba, the logic here can be removed as well. Also, remove confusing and redundant preprocessor code. Also, remove no longer needed version.h include, which was needed for INIT_PROTO_VERSION.
2022-03-25refactor: remove unused boost header include in bitcoin-util.cppSebastian Falbesoner
This header was included since the introduction of bitcoin-util in commit 13762bcc9618138dd28b53c2031defdc9d762d26, but boost was actually never used (see `git log -S boost ./src/bitcoin-util.cpp`).
2022-02-22Output license info when binaries are passed -versionfanquake
Consolidate to outputting the licensing info when we pass -version to a binary, i.e bitcoind -version: ```bash itcoin Core version v22.99.0-fc1f355913f6-dirty Copyright (C) 2009-2022 The Bitcoin Core developers Please contribute if you find Bitcoin Core useful. Visit <https://bitcoincore.org/> for further information about the software. The source code is available from <https://github.com/bitcoin/bitcoin>. This is experimental software. Distributed under the MIT software license, see the accompanying file COPYING or <https://opensource.org/licenses/MIT> ```
2021-12-30scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: * 2020: fa0074e2d82928016a43ca408717154a1c70a4db * 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2021-06-18refactor: Pass grind args vector as const referenceMarcoFalke
2021-06-18Remove gArgs from AppInitUtilMarcoFalke
Also fix incorrect {}
2021-06-18Remove unused OptionsCategory arg from AddCommandMarcoFalke
2021-06-18Remove unused includes from bitcoin-utilMarcoFalke
2021-02-07bitcoin-util: use AddCommand / GetCommandAnthony Towns
2021-01-18Merge #20938: build: fix linking against -latomic when building for riscvWladimir J. van der Laan
54ce4fac80689621dcbcc76169b2b00b179ee743 build: improve macro for testing -latomic requirement (fanquake) 2c010b9c56f069efad2b2c10bffaef4ed059736e add std::atomic include to bitcoin-util.cpp (fanquake) Pull request description: Since the merge of #19937, riscv builds have been failing, due to a link issue with [`std::atomic_exchange`](https://en.cppreference.com/w/cpp/atomic/atomic_exchange) in `bitcoin-util`: ```bash CXXLD bitcoin-util bitcoin_util-bitcoin-util.o: In function `grind_task': /home/ubuntu/build/bitcoin/distsrc-riscv64-linux-gnu/src/bitcoin-util.cpp:98: undefined reference to `__atomic_exchange_1' collect2: error: ld returned 1 exit status ``` We have a [macro](https://github.com/bitcoin/bitcoin/blob/master/build-aux/m4/l_atomic.m4) that tries to determine when `-latomic` is required, however it doesn't quite work well enough, as it's currently determining it isn't needed: ```bash ./autogen.sh ./configure --prefix=/home/ubuntu/bitcoin/depends/riscv64-linux-gnu ... checking whether std::atomic can be used without link library... yes ``` This PR adds a call to `std::atomic_exchange` to the macro, which will get us properly linked against `-latomic` on riscv: ```bash checking whether std::atomic can be used without link library... no checking whether std::atomic needs -latomic... yes ``` Also adds an `<atomic>` include to `bitcoin-util.cpp`. ACKs for top commit: laanwj: Tested ACK 54ce4fac80689621dcbcc76169b2b00b179ee743 Tree-SHA512: 963c875097ee96b131163ae8109bcf8fecf4451d20faa2f3d223f9938ea3d8d1ed5604e12ad82c2b4b1c605fd293a9b6b08fefc00dd3e68d09c49e95029c6f50
2021-01-15build: fix RELOC_SECTION security check for bitcoin-utilfanquake
The binutils we use for gitian builds strips the reloc section from Windows binaries, which breaks ASLR. As a temporary workaround, export main(). This is the same workaround as #18702 (bitcoin-cli), and will fix the currently failing security check: ```bash + make -j1 -C src check-security make: Entering directory '/home/ubuntu/build/bitcoin/distsrc-x86_64-w64-mingw32/src' Checking binary security... bitcoin-util.exe: failed RELOC_SECTION make: *** [check-security] Error 1 ``` Relevant upstream issue: https://sourceware.org/bugzilla/show_bug.cgi?id=19011
2021-01-15add std::atomic include to bitcoin-util.cppfanquake
2021-01-12doc: Add manual page generation for bitcoin-utilWladimir J. van der Laan
- Add `-version` option to `bitcoin-util` - Add `bitcoin-util` call to `gen-manpages.sh` - Add stub manual page `bitcoin-util.1` - Add install of `bitcoin-util.1` to build system
2021-01-12Add bitcoin-util command line utilityAnthony Towns