Skip to content

Commit 09b5833

Browse files
Merge pull request dashpay#5767 from knst/bitcoinserver-15639-p3
refactor: pull libbitcoin_server code out of wallet code 5/5
2 parents c25d9ae + 13188e1 commit 09b5833

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1021
-806
lines changed

ci/lint/04_install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
export LC_ALL=C
88

9+
travis_retry sudo apt update && sudo apt install -y clang-format-9
10+
sudo update-alternatives --install /usr/bin/clang-format clang-format $(which clang-format-9 ) 100
11+
sudo update-alternatives --install /usr/bin/clang-format-diff clang-format-diff $(which clang-format-diff-9) 100
12+
913
travis_retry pip3 install codespell==1.17.1
1014
travis_retry pip3 install flake8==3.8.3
1115
travis_retry pip3 install vulture==2.3

src/Makefile.am

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ BITCOIN_CORE_H = \
141141
cachemap.h \
142142
cachemultimap.h \
143143
blockfilter.h \
144+
bloom.h \
144145
chain.h \
145146
chainparams.h \
146147
chainparamsbase.h \
@@ -149,6 +150,7 @@ BITCOIN_CORE_H = \
149150
clientversion.h \
150151
coinjoin/coinjoin.h \
151152
coinjoin/client.h \
153+
coinjoin/common.h \
152154
coinjoin/context.h \
153155
coinjoin/options.h \
154156
coinjoin/server.h \
@@ -169,6 +171,7 @@ BITCOIN_CORE_H = \
169171
cuckoocache.h \
170172
ctpl_stl.h \
171173
cxxtimer.hpp \
174+
dbwrapper.h \
172175
deploymentinfo.h \
173176
deploymentstatus.h \
174177
evo/assetlocktx.h \
@@ -210,12 +213,12 @@ BITCOIN_CORE_H = \
210213
indirectmap.h \
211214
init.h \
212215
interfaces/chain.h \
216+
interfaces/coinjoin.h \
213217
interfaces/handler.h \
214218
interfaces/node.h \
215219
interfaces/wallet.h \
216220
key.h \
217221
key_io.h \
218-
dbwrapper.h \
219222
limitedmap.h \
220223
llmq/blockprocessor.h \
221224
llmq/chainlocks.h \
@@ -259,7 +262,9 @@ BITCOIN_CORE_H = \
259262
node/coin.h \
260263
node/coinstats.h \
261264
node/context.h \
265+
node/psbt.h \
262266
node/transaction.h \
267+
node/ui_interface.h \
263268
node/utxo_snapshot.h \
264269
noui.h \
265270
outputtype.h \
@@ -305,13 +310,12 @@ BITCOIN_CORE_H = \
305310
support/lockedpool.h \
306311
sync.h \
307312
timestampindex.h \
308-
threadsafety.h \
309313
threadinterrupt.h \
314+
threadsafety.h \
310315
timedata.h \
311316
torcontrol.h \
312317
txdb.h \
313318
txmempool.h \
314-
ui_interface.h \
315319
undo.h \
316320
unordered_lru_cache.h \
317321
util/bip32.h \
@@ -326,8 +330,6 @@ BITCOIN_CORE_H = \
326330
util/hasher.h \
327331
util/hash_type.h \
328332
util/irange.h \
329-
util/spanparsing.h \
330-
util/system.h \
331333
util/asmap.h \
332334
util/getuniquepath.h \
333335
util/macros.h \
@@ -342,20 +344,22 @@ BITCOIN_CORE_H = \
342344
util/ranges_set.h \
343345
util/sock.h \
344346
util/string.h \
347+
util/spanparsing.h \
348+
util/system.h \
345349
util/time.h \
346350
util/thread.h \
347351
util/threadnames.h \
348352
util/trace.h \
349353
util/translation.h \
350-
util/vector.h \
354+
util/ui_change_type.h \
351355
util/url.h \
352356
util/vector.h \
353357
validation.h \
354358
validationinterface.h \
355359
versionbits.h \
356-
walletinitinterface.h \
357360
wallet/bdb.h \
358361
wallet/coincontrol.h \
362+
wallet/coinselection.h \
359363
wallet/context.h \
360364
wallet/crypter.h \
361365
wallet/db.h \
@@ -370,7 +374,7 @@ BITCOIN_CORE_H = \
370374
wallet/walletdb.h \
371375
wallet/wallettool.h \
372376
wallet/walletutil.h \
373-
wallet/coinselection.h \
377+
walletinitinterface.h \
374378
warnings.h \
375379
zmq/zmqabstractnotifier.h \
376380
zmq/zmqnotificationinterface.h \
@@ -402,7 +406,6 @@ libbitcoin_server_a_SOURCES = \
402406
chain.cpp \
403407
coinjoin/coinjoin.cpp \
404408
coinjoin/context.cpp \
405-
coinjoin/options.cpp \
406409
coinjoin/server.cpp \
407410
consensus/tx_verify.cpp \
408411
dbwrapper.cpp \
@@ -421,6 +424,14 @@ libbitcoin_server_a_SOURCES = \
421424
evo/specialtx.cpp \
422425
evo/specialtxman.cpp \
423426
flatfile.cpp \
427+
governance/classes.cpp \
428+
governance/exceptions.cpp \
429+
governance/governance.cpp \
430+
governance/object.cpp \
431+
governance/validators.cpp \
432+
governance/vote.cpp \
433+
governance/votedb.cpp \
434+
gsl/assert.cpp \
424435
httprpc.cpp \
425436
httpserver.cpp \
426437
i2p.cpp \
@@ -429,14 +440,6 @@ libbitcoin_server_a_SOURCES = \
429440
index/coinstatsindex.cpp \
430441
index/txindex.cpp \
431442
init.cpp \
432-
governance/governance.cpp \
433-
governance/classes.cpp \
434-
governance/exceptions.cpp \
435-
governance/object.cpp \
436-
governance/validators.cpp \
437-
governance/vote.cpp \
438-
governance/votedb.cpp \
439-
gsl/assert.cpp \
440443
llmq/quorums.cpp \
441444
llmq/blockprocessor.cpp \
442445
llmq/commitment.cpp \
@@ -468,7 +471,9 @@ libbitcoin_server_a_SOURCES = \
468471
node/coinstats.cpp \
469472
node/context.cpp \
470473
node/interfaces.cpp \
474+
node/psbt.cpp \
471475
node/transaction.cpp \
476+
node/ui_interface.cpp \
472477
noui.cpp \
473478
policy/fees.cpp \
474479
policy/policy.cpp \
@@ -494,7 +499,6 @@ libbitcoin_server_a_SOURCES = \
494499
torcontrol.cpp \
495500
txdb.cpp \
496501
txmempool.cpp \
497-
ui_interface.cpp \
498502
validation.cpp \
499503
validationinterface.cpp \
500504
versionbits.cpp \
@@ -525,7 +529,7 @@ libbitcoin_wallet_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(SQLITE_CFLAG
525529
libbitcoin_wallet_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
526530
libbitcoin_wallet_a_SOURCES = \
527531
coinjoin/client.cpp \
528-
coinjoin/options.cpp \
532+
coinjoin/interfaces.cpp \
529533
coinjoin/util.cpp \
530534
hdchain.cpp \
531535
wallet/coincontrol.cpp \
@@ -735,6 +739,8 @@ libbitcoin_util_a_SOURCES = \
735739
bls/bls_ies.h \
736740
bls/bls_worker.cpp \
737741
bls/bls_worker.h \
742+
coinjoin/common.cpp \
743+
coinjoin/options.cpp \
738744
support/lockedpool.cpp \
739745
chainparamsbase.cpp \
740746
clientversion.cpp \
@@ -870,9 +876,7 @@ endif
870876
# https://eli.thegreenplace.net/2013/07/09/library-order-in-static-linking#circular-dependency)
871877
dash_wallet_LDADD = \
872878
$(LIBBITCOIN_WALLET_TOOL) \
873-
$(LIBBITCOIN_SERVER) \
874879
$(LIBBITCOIN_WALLET) \
875-
$(LIBBITCOIN_SERVER) \
876880
$(LIBBITCOIN_COMMON) \
877881
$(LIBBITCOIN_CONSENSUS) \
878882
$(LIBBITCOIN_UTIL) \

src/banman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <banman.h>
77

88
#include <netaddress.h>
9-
#include <ui_interface.h>
9+
#include <node/ui_interface.h>
1010
#include <util/system.h>
1111
#include <util/time.h>
1212
#include <util/translation.h>

src/bench/coin_selection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static void CoinSelection(benchmark::Bench& bench)
3131
{
3232
NodeContext node;
3333
auto chain = interfaces::MakeChain(node);
34-
CWallet wallet(chain.get(), "", CreateDummyWalletDatabase());
34+
CWallet wallet(chain.get(), /*coinjoin_loader=*/ nullptr, "", CreateDummyWalletDatabase());
3535
wallet.SetupLegacyScriptPubKeyMan();
3636
std::vector<std::unique_ptr<CWalletTx>> wtxs;
3737
LOCK(wallet.cs_wallet);
@@ -64,7 +64,7 @@ static void CoinSelection(benchmark::Bench& bench)
6464
typedef std::set<CInputCoin> CoinSet;
6565
static NodeContext testNode;
6666
static auto testChain = interfaces::MakeChain(testNode);
67-
static CWallet testWallet(testChain.get(), "", CreateDummyWalletDatabase());
67+
static CWallet testWallet(testChain.get(), /*coinjoin_loader=*/ nullptr, "", CreateDummyWalletDatabase());
6868
std::vector<std::unique_ptr<CWalletTx>> wtxn;
6969

7070
// Copied from src/wallet/test/coinselector_tests.cpp

src/bench/wallet_balance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static void WalletBalance(benchmark::Bench& bench, const bool set_dirty, const b
2424
};
2525
const auto& ADDRESS_WATCHONLY = ADDRESS_B58T_UNSPENDABLE;
2626

27-
CWallet wallet{test_setup.m_node.chain.get(), "", CreateMockWalletDatabase()};
27+
CWallet wallet{test_setup.m_node.chain.get(), test_setup.m_node.coinjoin_loader.get(), "", CreateMockWalletDatabase()};
2828
{
2929
wallet.SetupLegacyScriptPubKeyMan();
3030
bool first_run;

src/bitcoind.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#include <init.h>
1515
#include <interfaces/chain.h>
1616
#include <node/context.h>
17+
#include <node/ui_interface.h>
1718
#include <noui.h>
1819
#include <shutdown.h>
19-
#include <ui_interface.h>
2020
#include <util/check.h>
2121
#include <util/system.h>
2222
#include <util/strencodings.h>

0 commit comments

Comments
 (0)