Skip to content

Commit 566fd2d

Browse files
f0fa6de Merge bitcoin#26286: test: Remove unused txmempool include from tests (MacroFake) 020cdb8 Merge bitcoin#26067: util: improve bitcoin-wallet exit codes (MacroFake) 5078666 Merge bitcoin#32765: test: Fix list index out of range error in feature_bip68_sequence.py (merge-script) 83eaf94 partial Merge bitcoin#27177: test: fix intermittent issue in `feature_bip68_sequence` (Andrew Chow) 3d2ac64 Merge bitcoin#26277: test: Remove confusing DUMMY_P2WPKH_SCRIPT (fanquake) d039171 Merge bitcoin#26142: Use `PACKAGE_NAME` in messages rather than hardcoding "Bitcoin Core" (MacroFake) e011ce5 Merge bitcoin#26313: doc: consolidate library documentation to libraries.md (MacroFake) 83da1a1 Merge bitcoin#25526: wallet: avoid double keypool TopUp() call on descriptor wallets (Andrew Chow) 931f6eb Merge bitcoin#26109: rpc, doc: getpeerinfo updates (Andrew Chow) 1e69f8e Merge bitcoin#26675: wallet: For feebump, ignore abandoned descendant spends (Andrew Chow) Pull request description: ## What was done? Regular backports from Bitcoin Core v25 + extra backport-fix for `feature_bip68_sequence.py`. ## How Has This Been Tested? Run unit & functional tests ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: PastaPastaPasta: utACK f0fa6de UdjinM6: utACK f0fa6de Tree-SHA512: 8e8787cf5734aa37cb48e98bf6a35763274e24be071e490663f4e5dba8cb22e914b1bf8e2c55b9294fee69ccb5d52ff888058ad928514d3baab6601b429fda79
2 parents b51524e + f0fa6de commit 566fd2d

30 files changed

+198
-131
lines changed

contrib/devtools/gen-manpages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
for relpath in BINARIES:
3737
abspath = os.path.join(builddir, relpath)
3838
try:
39-
r = subprocess.run([abspath, '--version'], stdout=subprocess.PIPE, universal_newlines=True)
39+
r = subprocess.run([abspath, "--version"], stdout=subprocess.PIPE, check=True, universal_newlines=True)
4040
except IOError:
4141
print(f'{abspath} not found or not an executable', file=sys.stderr)
4242
sys.exit(1)

doc/design/libraries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class dash-qt,dashd,dash-cli,dash-wallet bold
8585

8686
</td></tr></table>
8787

88-
- The graph shows what _linker symbols_ (functions and variables) from each library other libraries can call and reference directly, but it is not a call graph. For example, there is no arrow connecting *libbitcoin_wallet* and *libbitcoin_node* libraries, because these libraries are intended to be modular and not depend on each other's internal implementation details. But wallet code still is still able to call node code indirectly through the `interfaces::Chain` abstract class in [`interfaces/chain.h`](../../src/interfaces/chain.h) and node code calls wallet code through the `interfaces::ChainClient` and `interfaces::Chain::Notifications` abstract classes in the same file. In general, defining abstract classes in [`src/interfaces/`](../../src/interfaces/) can be a convenient way of avoiding unwanted direct dependencies or circular dependencies between libraries.
88+
- The graph shows what _linker symbols_ (functions and variables) from each library other libraries can call and reference directly, but it is not a call graph. For example, there is no arrow connecting *libbitcoin_wallet* and *libbitcoin_node* libraries, because these libraries are intended to be modular and not depend on each other's internal implementation details. But wallet code is still able to call node code indirectly through the `interfaces::Chain` abstract class in [`interfaces/chain.h`](../../src/interfaces/chain.h) and node code calls wallet code through the `interfaces::ChainClient` and `interfaces::Chain::Notifications` abstract classes in the same file. In general, defining abstract classes in [`src/interfaces/`](../../src/interfaces/) can be a convenient way of avoiding unwanted direct dependencies or circular dependencies between libraries.
8989

9090
- *libdash_consensus* should be a standalone dependency that any library can depend on, and it should not depend on any other libraries itself.
9191

src/Makefile.am

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,7 @@ obj/build.h: FORCE
465465
"$(abs_top_srcdir)"
466466
libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
467467

468-
469-
# server: shared between dashd and dash-qt
470-
# Contains code accessing mempool and chain state that is meant to be separated
471-
# from wallet and gui code (see node/README.md). Shared code should go in
472-
# libbitcoin_common or libbitcoin_util libraries, instead.
468+
# node #
473469
libbitcoin_node_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) $(MINIUPNPC_CPPFLAGS) $(NATPMP_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)
474470
libbitcoin_node_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
475471
libbitcoin_node_a_SOURCES = \
@@ -619,7 +615,9 @@ endif
619615
if !ENABLE_WALLET
620616
libbitcoin_node_a_SOURCES += dummywallet.cpp
621617
endif
618+
#
622619

620+
# zmq #
623621
if ENABLE_ZMQ
624622
libbitcoin_zmq_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) $(ZMQ_CFLAGS)
625623
libbitcoin_zmq_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
@@ -630,10 +628,9 @@ libbitcoin_zmq_a_SOURCES = \
630628
zmq/zmqrpc.cpp \
631629
zmq/zmqutil.cpp
632630
endif
631+
#
633632

634-
635-
# wallet: shared between dashd and dash-qt, but only linked
636-
# when wallet enabled
633+
# wallet #
637634
libbitcoin_wallet_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) $(BDB_CPPFLAGS) $(SQLITE_CFLAGS)
638635
libbitcoin_wallet_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
639636
libbitcoin_wallet_a_SOURCES = \
@@ -677,18 +674,17 @@ endif
677674
if USE_BDB
678675
libbitcoin_wallet_a_SOURCES += wallet/bdb.cpp wallet/salvage.cpp
679676
endif
677+
#
680678

679+
# wallet tool #
681680
libbitcoin_wallet_tool_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS)
682681
libbitcoin_wallet_tool_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
683682
libbitcoin_wallet_tool_a_SOURCES = \
684683
wallet/wallettool.cpp \
685684
$(BITCOIN_CORE_H)
685+
#
686686

687-
# crypto primitives library
688-
689-
# crypto_base contains the unspecialized (unoptimized) versions of our
690-
# crypto functions. Functions that require custom compiler flags and/or
691-
# runtime opt-in are omitted.
687+
# crypto #
692688
crypto_libbitcoin_crypto_base_la_CPPFLAGS = $(AM_CPPFLAGS) $(PIC_FLAGS)
693689

694690
# Specify -static in both CXXFLAGS and LDFLAGS so libtool will only build a
@@ -849,8 +845,9 @@ crypto_libbitcoin_crypto_arm_shani_la_CPPFLAGS = $(AM_CPPFLAGS)
849845
crypto_libbitcoin_crypto_arm_shani_la_CXXFLAGS += $(ARM_SHANI_CXXFLAGS)
850846
crypto_libbitcoin_crypto_arm_shani_la_CPPFLAGS += -DENABLE_ARM_SHANI
851847
crypto_libbitcoin_crypto_arm_shani_la_SOURCES = crypto/sha256_arm_shani.cpp
848+
#
852849

853-
# consensus: shared between all executables that validate any consensus rules.
850+
# consensus #
854851
libbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS)
855852
libbitcoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
856853
libbitcoin_consensus_a_SOURCES = \
@@ -891,8 +888,9 @@ libbitcoin_consensus_a_SOURCES = \
891888
util/strencodings.h \
892889
util/string.cpp \
893890
version.h
891+
#
894892

895-
# common: shared between dashd, and dash-qt and non-server tools
893+
# common #
896894
libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS)
897895
libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
898896
libbitcoin_common_a_SOURCES = \
@@ -937,8 +935,9 @@ libbitcoin_common_a_SOURCES = \
937935
script/standard.cpp \
938936
warnings.cpp \
939937
$(BITCOIN_CORE_H)
938+
#
940939

941-
# util: shared between all executables.
940+
# util #
942941
libbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS)
943942
libbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
944943
libbitcoin_util_a_SOURCES = \
@@ -996,8 +995,9 @@ libbitcoin_util_a_SOURCES = \
996995
if USE_LIBEVENT
997996
libbitcoin_util_a_SOURCES += util/url.cpp
998997
endif
998+
#
999999

1000-
# cli: shared between dash-cli and dash-qt
1000+
# cli #
10011001
libbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
10021002
libbitcoin_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
10031003
libbitcoin_cli_a_SOURCES = \

src/Makefile.test_util.include

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@
55
LIBTEST_UTIL=libtest_util.a
66

77
EXTRA_LIBRARIES += \
8-
$(LIBTEST_UTIL)
8+
$(LIBTEST_UTIL)
99

1010
TEST_UTIL_H = \
11-
test/util/blockfilter.h \
12-
test/util/chainstate.h \
13-
test/util/json.h \
14-
test/util/index.h \
15-
test/util/llmq_tests.h \
16-
test/util/logging.h \
17-
test/util/mining.h \
18-
test/util/net.h \
19-
test/util/poolresourcetester.h \
20-
test/util/script.h \
21-
test/util/setup_common.h \
22-
test/util/str.h \
23-
test/util/transaction_utils.h \
24-
test/util/wallet.h \
25-
test/util/validation.h \
26-
test/util/xoroshiro128plusplus.h
11+
test/util/blockfilter.h \
12+
test/util/chainstate.h \
13+
test/util/json.h \
14+
test/util/index.h \
15+
test/util/llmq_tests.h \
16+
test/util/logging.h \
17+
test/util/mining.h \
18+
test/util/net.h \
19+
test/util/poolresourcetester.h \
20+
test/util/script.h \
21+
test/util/setup_common.h \
22+
test/util/str.h \
23+
test/util/transaction_utils.h \
24+
test/util/txmempool.h \
25+
test/util/wallet.h \
26+
test/util/validation.h \
27+
test/util/xoroshiro128plusplus.h
2728

2829
libtest_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS)
2930
libtest_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
@@ -38,6 +39,7 @@ libtest_util_a_SOURCES = \
3839
test/util/setup_common.cpp \
3940
test/util/str.cpp \
4041
test/util/transaction_utils.cpp \
42+
test/util/txmempool.cpp \
4143
test/util/validation.cpp \
4244
test/util/wallet.cpp \
4345
$(TEST_UTIL_H)

src/bitcoin-wallet.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ static void SetupWalletToolArgs(ArgsManager& argsman)
4949
argsman.AddCommand("createfromdump", "Create new wallet file from dumped records", OptionsCategory::COMMANDS);
5050
}
5151

52-
static bool WalletAppInit(ArgsManager& args, int argc, char* argv[])
52+
static std::optional<int> WalletAppInit(ArgsManager& args, int argc, char* argv[])
5353
{
5454
SetupWalletToolArgs(args);
5555
std::string error_message;
5656
if (!args.ParseParameters(argc, argv, error_message)) {
5757
tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error_message);
58-
return false;
58+
return EXIT_FAILURE;
5959
}
60-
if (argc < 2 || HelpRequested(args) || args.IsArgSet("-version")) {
60+
const bool missing_args{argc < 2};
61+
if (missing_args || HelpRequested(args) || args.IsArgSet("-version")) {
6162
std::string strUsage = strprintf("%s dash-wallet version", PACKAGE_NAME) + " " + FormatFullVersion() + "\n";
6263

6364
if (args.IsArgSet("-version")) {
@@ -72,20 +73,24 @@ static bool WalletAppInit(ArgsManager& args, int argc, char* argv[])
7273
strUsage += "\n" + args.GetHelpMessage();
7374
}
7475
tfm::format(std::cout, "%s", strUsage);
75-
return false;
76+
if (missing_args) {
77+
tfm::format(std::cerr, "Error: too few parameters\n");
78+
return EXIT_FAILURE;
79+
}
80+
return EXIT_SUCCESS;
7681
}
7782

7883
// check for printtoconsole, allow -debug
7984
LogInstance().m_print_to_console = args.GetBoolArg("-printtoconsole", args.GetBoolArg("-debug", false));
8085

8186
if (!CheckDataDirOption()) {
8287
tfm::format(std::cerr, "Error: Specified data directory \"%s\" does not exist.\n", args.GetArg("-datadir", ""));
83-
return false;
88+
return EXIT_FAILURE;
8489
}
8590
// Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)
8691
SelectParams(args.GetChainName());
8792

88-
return true;
93+
return std::nullopt;
8994
}
9095

9196
MAIN_FUNCTION
@@ -98,7 +103,7 @@ MAIN_FUNCTION
98103
SetupEnvironment();
99104
RandomInit();
100105
try {
101-
if (!WalletAppInit(args, argc, argv)) return EXIT_FAILURE;
106+
if (const auto maybe_exit{WalletAppInit(args, argc, argv)}) return *maybe_exit;
102107
} catch (...) {
103108
PrintExceptionContinue(std::current_exception(), "WalletAppInit()");
104109
return EXIT_FAILURE;

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2537,7 +2537,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
25372537

25382538
const auto BadPortWarning = [](const char* prefix, uint16_t port) {
25392539
return strprintf(_("%s request to listen on port %u. This port is considered \"bad\" and "
2540-
"thus it is unlikely that any Dash Core peers connect to it. See "
2540+
"thus it is unlikely that any peer will connect to it. See "
25412541
"doc/p2p-bad-ports.md for details and a full list."),
25422542
prefix,
25432543
port);

src/net_processing.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,7 @@ struct Peer {
285285

286286
struct TxRelay {
287287
mutable RecursiveMutex m_bloom_filter_mutex;
288-
/** Whether the peer wishes to receive transaction announcements.
289-
*
290-
* This is initially set based on the fRelay flag in the received
291-
* `version` message. If initially set to false, it can only be flipped
292-
* to true if we have offered the peer NODE_BLOOM services and it sends
293-
* us a `filterload` or `filterclear` message. See BIP37. */
288+
/** Whether we relay transactions to this peer. */
294289
bool m_relay_txs GUARDED_BY(m_bloom_filter_mutex){false};
295290
/** A bloom filter for which transactions to announce to the peer. See BIP37. */
296291
std::unique_ptr<CBloomFilter> m_bloom_filter PT_GUARDED_BY(m_bloom_filter_mutex) GUARDED_BY(m_bloom_filter_mutex){nullptr};
@@ -3817,11 +3812,12 @@ void PeerManagerImpl::ProcessMessage(
38173812
}
38183813
peer->m_starting_height = starting_height;
38193814

3820-
// We only initialize the m_tx_relay data structure if:
3821-
// - this isn't an outbound block-relay-only connection; and
3815+
// We only initialize the Peer::TxRelay m_relay_txs data structure if:
3816+
// - this isn't an outbound block-relay-only connection, and
38223817
// - this isn't an outbound feeler connection, and
3823-
// - fRelay=true or we're offering NODE_BLOOM to this peer
3824-
// (NODE_BLOOM means that the peer may turn on tx relay later)
3818+
// - fRelay=true (the peer wishes to receive transaction announcements)
3819+
// or we're offering NODE_BLOOM to this peer. NODE_BLOOM means that
3820+
// the peer may turn on transaction relay later.
38253821
if (!pfrom.IsBlockOnlyConn() &&
38263822
!pfrom.IsFeelerConn() &&
38273823
(fRelay || (peer->m_our_services & NODE_BLOOM))) {

src/qt/forms/optionsdialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@
430430
<item>
431431
<widget class="QLineEdit" name="externalSignerPath">
432432
<property name="toolTip">
433-
<string>Full path to a Dash Core compatible script (e.g. C:\Downloads\hwi.exe or /Users/you/Downloads/hwi.py). Beware: malware can steal your coins!</string>
433+
<string>Full path to a %1 compatible script (e.g. C:\Downloads\hwi.exe or /Users/you/Downloads/hwi.py). Beware: malware can steal your coins!</string>
434434
</property>
435435
</widget>
436436
</item>

src/qt/optionsdialog.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
139139

140140
showPage(0);
141141

142-
#ifndef ENABLE_EXTERNAL_SIGNER
142+
#ifdef ENABLE_EXTERNAL_SIGNER
143+
ui->externalSignerPath->setToolTip(ui->externalSignerPath->toolTip().arg(PACKAGE_NAME));
144+
#else
143145
//: "External signing" means using devices such as hardware wallets.
144146
ui->externalSignerPath->setToolTip(tr("Compiled without external signing support (required for external signing)"));
145147
ui->externalSignerPath->setEnabled(false);

src/rpc/net.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static RPCHelpMan getpeerinfo()
124124
{RPCResult::Type::STR_HEX, "verified_pubkey_hash", "Only present when the peer is a masternode and successfully "
125125
"authenticated via MNAUTH. In this case, this field contains the "
126126
"hash of the masternode's operator public key"},
127-
{RPCResult::Type::BOOL, "relaytxes", /*optional=*/true, "Whether peer has asked us to relay transactions to it"},
127+
{RPCResult::Type::BOOL, "relaytxes", /*optional=*/true, "Whether we relay transactions to this peer"},
128128
{RPCResult::Type::NUM_TIME, "lastsend", "The " + UNIX_EPOCH_TIME + " of the last send"},
129129
{RPCResult::Type::NUM_TIME, "lastrecv", "The " + UNIX_EPOCH_TIME + " of the last receive"},
130130
{RPCResult::Type::NUM_TIME, "last_transaction", "The " + UNIX_EPOCH_TIME + " of the last valid transaction received from this peer"},
@@ -133,9 +133,9 @@ static RPCHelpMan getpeerinfo()
133133
{RPCResult::Type::NUM, "bytesrecv", "The total bytes received"},
134134
{RPCResult::Type::NUM_TIME, "conntime", "The " + UNIX_EPOCH_TIME + " of the connection"},
135135
{RPCResult::Type::NUM, "timeoffset", "The time offset in seconds"},
136-
{RPCResult::Type::NUM, "pingtime", /*optional=*/true, "ping time (if available)"},
137-
{RPCResult::Type::NUM, "minping", /*optional=*/true, "minimum observed ping time (if any at all)"},
138-
{RPCResult::Type::NUM, "pingwait", /*optional=*/true, "ping wait (if non-zero)"},
136+
{RPCResult::Type::NUM, "pingtime", /*optional=*/true, "The last ping time in milliseconds (ms), if any"},
137+
{RPCResult::Type::NUM, "minping", /*optional=*/true, "The minimum observed ping time in milliseconds (ms), if any"},
138+
{RPCResult::Type::NUM, "pingwait", /*optional=*/true, "The duration in milliseconds (ms) of an outstanding ping (if non-zero)"},
139139
{RPCResult::Type::NUM, "version", "The peer version, such as 70001"},
140140
{RPCResult::Type::STR, "subver", "The string version"},
141141
{RPCResult::Type::BOOL, "inbound", "Inbound (true) or Outbound (false)"},
@@ -219,7 +219,9 @@ static RPCHelpMan getpeerinfo()
219219
ServiceFlags services{statestats.their_services};
220220
obj.pushKV("services", strprintf("%016x", services));
221221
obj.pushKV("servicesnames", GetServicesNames(services));
222-
obj.pushKV("relaytxes", statestats.m_relay_txs);
222+
if (fStateStats) {
223+
obj.pushKV("relaytxes", statestats.m_relay_txs);
224+
}
223225
if (!stats.verifiedProRegTxHash.IsNull()) {
224226
obj.pushKV("verified_proregtx_hash", stats.verifiedProRegTxHash.ToString());
225227
}

0 commit comments

Comments
 (0)