From 9b676337979144402fa4d8065aeaa5fc3d28d588 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 1 Jul 2020 15:18:55 +0200 Subject: [PATCH] Merge #19331: build: Do not include server symbols in wallet faca73000fa8975c28f6be8be01957c1ae94ea62 ci: Install fixed version of clang-format for linters (MarcoFalke) fa4695da4c69646b58a8fa0b6b30146bb234deb8 build: Sort Makefile.am after renaming file (MarcoFalke) cccc2784a3bb10fa8e43be7e68207cafb12bd915 scripted-diff: Move ui_interface to the node lib (MarcoFalke) fa72ca6a9d90d66012765b0043fd819698b94ba8 qt: Remove unused includes (MarcoFalke) fac96e6450d595fe67168cb7afa7692da6cc9973 wallet: Do not include server symbols (MarcoFalke) fa0f6c58c1c6d10f04c4e65a424cc51ebca50a8c Revert "Fix link error with --enable-debug" (MarcoFalke) Pull request description: This reverts a hacky workaround from commit b83cc0f, which only happens to work due to compiler optimizations. Then, it actually fixes the linker error. The underlying problem is that the wallet includes symbols from the server (ui_interface), which usually results in linker failures. Though, in this specific case the linker failures have not been observed (unless `-O0`) because our compilers were smart enough to strip unused symbols. Fix the underlying problem by creating a new header-only with the needed symbol and move ui_interface to node to clarify that this is part of libbitcoin_server. ACKs for top commit: Sjors: ACK faca730 laanwj: ACK faca73000fa8975c28f6be8be01957c1ae94ea62 hebasto: re-ACK faca73000fa8975c28f6be8be01957c1ae94ea62, since the [previous](https://github.com/bitcoin/bitcoin/pull/19331#pullrequestreview-434420539) review: Tree-SHA512: e9731f249425aaea50b6db5fc7622e10078cf006721bb87989cac190a2ff224412f6f8a7dd83efd018835302337611f5839e29e15bef366047ed591cef58dfb4 --- ci/lint/04_install.sh | 4 ++++ src/Makefile.am | 36 +++++++++++++++++---------------- src/banman.cpp | 2 +- src/bitcoind.cpp | 2 +- src/httpserver.cpp | 2 +- src/index/base.cpp | 2 +- src/index/txindex.cpp | 2 +- src/init.cpp | 2 +- src/interfaces/wallet.h | 2 +- src/net.cpp | 1 + src/node/interfaces.cpp | 2 +- src/{ => node}/ui_interface.cpp | 2 +- src/{ => node}/ui_interface.h | 16 ++++----------- src/noui.cpp | 2 +- src/qt/bitcoin.cpp | 1 - src/qt/bitcoingui.cpp | 2 +- src/qt/paymentserver.cpp | 4 ++-- src/qt/sendcoinsdialog.cpp | 2 +- src/qt/splashscreen.cpp | 1 - src/qt/transactionview.cpp | 2 +- src/qt/walletmodel.cpp | 2 +- src/qt/walletview.cpp | 2 +- src/timedata.cpp | 2 +- src/txdb.cpp | 1 + src/util/ui_change_type.h | 15 ++++++++++++++ src/validation.cpp | 2 +- src/wallet/init.cpp | 2 +- src/wallet/interfaces.cpp | 2 +- src/wallet/wallet.h | 2 +- 29 files changed, 66 insertions(+), 53 deletions(-) rename src/{ => node}/ui_interface.cpp (99%) rename src/{ => node}/ui_interface.h (94%) create mode 100644 src/util/ui_change_type.h diff --git a/ci/lint/04_install.sh b/ci/lint/04_install.sh index 542c5b52e3fc6b..e7758a8c5799b2 100755 --- a/ci/lint/04_install.sh +++ b/ci/lint/04_install.sh @@ -6,6 +6,10 @@ export LC_ALL=C +travis_retry sudo apt update && sudo apt install -y clang-format-9 +sudo update-alternatives --install /usr/bin/clang-format clang-format $(which clang-format-9 ) 100 +sudo update-alternatives --install /usr/bin/clang-format-diff clang-format-diff $(which clang-format-diff-9) 100 + travis_retry pip3 install codespell==1.17.1 travis_retry pip3 install flake8==3.8.3 travis_retry pip3 install vulture==2.3 diff --git a/src/Makefile.am b/src/Makefile.am index e6179b9d12001a..251a8a68d64809 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -141,6 +141,7 @@ BITCOIN_CORE_H = \ cachemap.h \ cachemultimap.h \ blockfilter.h \ + bloom.h \ chain.h \ chainparams.h \ chainparamsbase.h \ @@ -170,6 +171,7 @@ BITCOIN_CORE_H = \ cuckoocache.h \ ctpl_stl.h \ cxxtimer.hpp \ + dbwrapper.h \ deploymentinfo.h \ deploymentstatus.h \ evo/assetlocktx.h \ @@ -216,7 +218,6 @@ BITCOIN_CORE_H = \ interfaces/wallet.h \ key.h \ key_io.h \ - dbwrapper.h \ limitedmap.h \ llmq/blockprocessor.h \ llmq/chainlocks.h \ @@ -262,6 +263,7 @@ BITCOIN_CORE_H = \ node/context.h \ node/psbt.h \ node/transaction.h \ + node/ui_interface.h \ node/utxo_snapshot.h \ noui.h \ outputtype.h \ @@ -307,13 +309,12 @@ BITCOIN_CORE_H = \ support/lockedpool.h \ sync.h \ timestampindex.h \ - threadsafety.h \ threadinterrupt.h \ + threadsafety.h \ timedata.h \ torcontrol.h \ txdb.h \ txmempool.h \ - ui_interface.h \ undo.h \ unordered_lru_cache.h \ util/bip32.h \ @@ -328,8 +329,6 @@ BITCOIN_CORE_H = \ util/hasher.h \ util/hash_type.h \ util/irange.h \ - util/spanparsing.h \ - util/system.h \ util/asmap.h \ util/getuniquepath.h \ util/macros.h \ @@ -344,20 +343,23 @@ BITCOIN_CORE_H = \ util/ranges_set.h \ util/sock.h \ util/string.h \ + util/spanparsing.h \ + util/system.h \ util/time.h \ util/thread.h \ util/threadnames.h \ util/trace.h \ util/translation.h \ - util/vector.h \ + util/ui_change_type.h \ util/url.h \ util/vector.h \ validation.h \ validationinterface.h \ versionbits.h \ - walletinitinterface.h \ + versionbitsinfo.h \ wallet/bdb.h \ wallet/coincontrol.h \ + wallet/coinselection.h \ wallet/context.h \ wallet/crypter.h \ wallet/db.h \ @@ -372,7 +374,7 @@ BITCOIN_CORE_H = \ wallet/walletdb.h \ wallet/wallettool.h \ wallet/walletutil.h \ - wallet/coinselection.h \ + walletinitinterface.h \ warnings.h \ zmq/zmqabstractnotifier.h \ zmq/zmqnotificationinterface.h \ @@ -425,21 +427,21 @@ libbitcoin_server_a_SOURCES = \ evo/specialtxman.cpp \ flatfile.cpp \ httprpc.cpp \ - httpserver.cpp \ - i2p.cpp \ - index/base.cpp \ - index/blockfilterindex.cpp \ - index/coinstatsindex.cpp \ - index/txindex.cpp \ - init.cpp \ - governance/governance.cpp \ governance/classes.cpp \ governance/exceptions.cpp \ + governance/governance.cpp \ governance/object.cpp \ governance/validators.cpp \ governance/vote.cpp \ governance/votedb.cpp \ gsl/assert.cpp \ + httpserver.cpp \ + i2p.cpp \ + index/base.cpp \ + index/blockfilterindex.cpp \ + index/coinstatsindex.cpp \ + index/txindex.cpp \ + init.cpp \ llmq/quorums.cpp \ llmq/blockprocessor.cpp \ llmq/commitment.cpp \ @@ -473,6 +475,7 @@ libbitcoin_server_a_SOURCES = \ node/interfaces.cpp \ node/psbt.cpp \ node/transaction.cpp \ + node/ui_interface.cpp \ noui.cpp \ policy/fees.cpp \ policy/policy.cpp \ @@ -498,7 +501,6 @@ libbitcoin_server_a_SOURCES = \ torcontrol.cpp \ txdb.cpp \ txmempool.cpp \ - ui_interface.cpp \ validation.cpp \ validationinterface.cpp \ versionbits.cpp \ diff --git a/src/banman.cpp b/src/banman.cpp index c7e9cb67447648..8f216ab8a05f5a 100644 --- a/src/banman.cpp +++ b/src/banman.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index def1807316e812..d56eb01afaf090 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -14,9 +14,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/src/httpserver.cpp b/src/httpserver.cpp index e9d1b4cd78c6f9..65c2967cfa4cb3 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -6,10 +6,10 @@ #include #include +#include #include // For HTTP status codes #include #include -#include #include #include #include diff --git a/src/index/base.cpp b/src/index/base.cpp index 4803fd68ea265a..cb860f544d4ab8 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -5,9 +5,9 @@ #include #include #include +#include #include #include -#include #include #include #include // For g_chainman diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp index cf22b279c7897e..a50b991bb4ce4b 100644 --- a/src/index/txindex.cpp +++ b/src/index/txindex.cpp @@ -4,8 +4,8 @@ #include #include +#include #include -#include #include #include #include diff --git a/src/init.cpp b/src/init.cpp index 891e8866dcc479..78610be7b61244 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -54,7 +55,6 @@ #include #include #include -#include #include #include #include diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index 06764000ceffa8..6f5fb776bb0a4d 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -11,8 +11,8 @@ #include // For CKeyID and CScriptID (definitions needed in CTxDestination instantiation) #include