Skip to content

Commit 63b9071

Browse files
2 parents b43af81 + f947086 commit 63b9071

19 files changed

+332
-293
lines changed

configure.ac

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -144,24 +144,12 @@ AC_ARG_WITH([miniupnpc],
144144
[use_upnp=$withval],
145145
[use_upnp=auto])
146146

147-
AC_ARG_ENABLE([upnp-default],
148-
[AS_HELP_STRING([--enable-upnp-default],
149-
[if UPNP is enabled, turn it on at startup (default is no)])],
150-
[use_upnp_default=$enableval],
151-
[use_upnp_default=no])
152-
153147
AC_ARG_WITH([natpmp],
154148
[AS_HELP_STRING([--with-natpmp],
155149
[enable NAT-PMP (default is yes if libnatpmp is found)])],
156150
[use_natpmp=$withval],
157151
[use_natpmp=auto])
158152

159-
AC_ARG_ENABLE([natpmp-default],
160-
[AS_HELP_STRING([--enable-natpmp-default],
161-
[if NAT-PMP is enabled, turn it on at startup (default is no)])],
162-
[use_natpmp_default=$enableval],
163-
[use_natpmp_default=no])
164-
165153
AC_ARG_ENABLE(tests,
166154
AS_HELP_STRING([--disable-tests],[do not compile tests (default is to compile)]),
167155
[use_tests=$enableval],
@@ -1609,16 +1597,8 @@ if test x$have_miniupnpc = xno; then
16091597
else
16101598
if test x$use_upnp != xno; then
16111599
AC_MSG_RESULT(yes)
1612-
AC_MSG_CHECKING([whether to build with UPnP enabled by default])
16131600
use_upnp=yes
1614-
upnp_setting=0
1615-
if test x$use_upnp_default != xno; then
1616-
use_upnp_default=yes
1617-
upnp_setting=1
1618-
fi
1619-
AC_MSG_RESULT($use_upnp_default)
1620-
AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state])
1621-
if test x$TARGET_OS = xwindows; then
1601+
AC_DEFINE([USE_UPNP], [1], [Define to 1 if UPnP support should be compiled in.]) if test x$TARGET_OS = xwindows; then
16221602
MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB"
16231603
fi
16241604
else
@@ -1637,15 +1617,8 @@ if test "x$have_natpmp" = xno; then
16371617
else
16381618
if test "x$use_natpmp" != xno; then
16391619
AC_MSG_RESULT([yes])
1640-
AC_MSG_CHECKING([whether to build with NAT-PMP enabled by default])
16411620
use_natpmp=yes
1642-
natpmp_setting=0
1643-
if test "x$use_natpmp_default" != xno; then
1644-
use_natpmp_default=yes
1645-
natpmp_setting=1
1646-
fi
1647-
AC_MSG_RESULT($use_natpmp_default)
1648-
AC_DEFINE_UNQUOTED([USE_NATPMP], [$natpmp_setting], [NAT-PMP support not compiled if undefined, otherwise value (0 or 1) determines default state])
1621+
AC_DEFINE([USE_NATPMP], [1], [Define to 1 if UPnP support should be compiled in.])
16491622
if test x$TARGET_OS = xwindows; then
16501623
NATPMP_CPPFLAGS="-DSTATICLIB -DNATPMP_STATICLIB"
16511624
fi

doc/build-unix.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ SQLite is required for the wallet:
9191

9292
To build Dash Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode)
9393

94-
Optional port mapping libraries (see: `--with-miniupnpc`, `--enable-upnp-default`, and `--with-natpmp`, `--enable-natpmp-default`):
94+
Optional port mapping libraries (see: `--with-miniupnpc` and `--with-natpmp`):
9595

9696
sudo apt install libminiupnpc-dev libnatpmp-dev
9797

@@ -154,7 +154,7 @@ SQLite is required for the wallet:
154154

155155
To build Dash Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode)
156156

157-
Optional port mapping libraries (see: `--with-miniupnpc`, `--enable-upnp-default`, and `--with-natpmp`, `--enable-natpmp-default`):
157+
Optional port mapping libraries (see: `--with-miniupnpc` and `--with-natpmp`):
158158

159159
sudo dnf install miniupnpc-devel libnatpmp-devel
160160

@@ -198,22 +198,14 @@ miniupnpc
198198

199199
[miniupnpc](https://miniupnp.tuxfamily.org) may be used for UPnP port mapping. It can be downloaded from [here](
200200
https://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and
201-
turned off by default. See the configure options for upnp behavior desired:
202-
203-
--without-miniupnpc No UPnP support miniupnp not required
204-
--disable-upnp-default (the default) UPnP support turned off by default at runtime
205-
--enable-upnp-default UPnP support turned on by default at runtime
201+
turned off by default.
206202

207203
libnatpmp
208204
---------
209205

210206
[libnatpmp](https://miniupnp.tuxfamily.org/libnatpmp.html) may be used for NAT-PMP port mapping. It can be downloaded
211207
from [here](https://miniupnp.tuxfamily.org/files/). NAT-PMP support is compiled in and
212-
turned off by default. See the configure options for NAT-PMP behavior desired:
213-
214-
--without-natpmp No NAT-PMP support, libnatpmp not required
215-
--disable-natpmp-default (the default) NAT-PMP support turned off by default at runtime
216-
--enable-natpmp-default NAT-PMP support turned on by default at runtime
208+
turned off by default.
217209

218210
Berkeley DB
219211
-----------

doc/release-notes-26896.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Build System
2+
------------
3+
4+
The --enable-upnp-default and --enable-natpmp-default options
5+
have been removed. If you want to use port mapping, you can
6+
configure it using a .conf file, or by passing the relevant
7+
options at runtime.

src/bench/block_assemble.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@
1717

1818
static void AssembleBlock(benchmark::Bench& bench)
1919
{
20-
RegTestingSetup test_setup;
20+
TestingSetup test_setup{
21+
CBaseChainParams::REGTEST,
22+
/* extra_args */ {
23+
"-nodebuglogfile",
24+
"-nodebug",
25+
},
26+
};
2127
const CScript redeemScript = CScript() << OP_DROP << OP_TRUE;
2228
const CScript SCRIPT_PUB =
2329
CScript() << OP_HASH160 << ToByteVector(CScriptID(redeemScript))

src/bench/duplicate_inputs.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616
static void DuplicateInputs(benchmark::Bench& bench)
1717
{
18-
RegTestingSetup test_setup;
18+
TestingSetup test_setup{
19+
CBaseChainParams::REGTEST,
20+
/* extra_args */ {
21+
"-nodebuglogfile",
22+
"-nodebug",
23+
},
24+
};
1925

2026
const CScript SCRIPT_PUB{CScript(OP_TRUE)};
2127

src/bench/mempool_eviction.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,22 @@ static void AddTx(const CTransactionRef& tx, const CAmount& nFee, CTxMemPool& po
1616
unsigned int sigOps = 1;
1717
LockPoints lp;
1818
pool.addUnchecked(CTxMemPoolEntry(
19-
tx, nFee, nTime, nHeight,
20-
spendsCoinbase, sigOps, lp));
19+
tx, nFee, nTime, nHeight,
20+
spendsCoinbase, sigOps, lp));
2121
}
2222

2323
// Right now this is only testing eviction performance in an extremely small
2424
// mempool. Code needs to be written to generate a much wider variety of
2525
// unique transactions for a more meaningful performance measurement.
2626
static void MempoolEviction(benchmark::Bench& bench)
2727
{
28-
RegTestingSetup test_setup;
28+
TestingSetup test_setup{
29+
CBaseChainParams::REGTEST,
30+
/* extra_args */ {
31+
"-nodebuglogfile",
32+
"-nodebug",
33+
},
34+
};
2935

3036
CMutableTransaction tx1 = CMutableTransaction();
3137
tx1.vin.resize(1);

src/bench/wallet_balance.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616
static void WalletBalance(benchmark::Bench& bench, const bool set_dirty, const bool add_watchonly, const bool add_mine, const uint32_t epoch_iters)
1717
{
18-
RegTestingSetup test_setup;
18+
TestingSetup test_setup{
19+
CBaseChainParams::REGTEST,
20+
/* extra_args */ {
21+
"-nodebuglogfile",
22+
"-nodebug",
23+
},
24+
};
1925
const auto& ADDRESS_WATCHONLY = ADDRESS_B58T_UNSPENDABLE;
2026

2127
CWallet wallet{test_setup.m_node.chain.get(), "", CreateMockWalletDatabase()};
@@ -24,7 +30,7 @@ static void WalletBalance(benchmark::Bench& bench, const bool set_dirty, const b
2430
bool first_run;
2531
if (wallet.LoadWallet(first_run) != DBErrors::LOAD_OK) assert(false);
2632
}
27-
auto handler = test_setup.m_node.chain->handleNotifications({ &wallet, [](CWallet*) {} });
33+
auto handler = test_setup.m_node.chain->handleNotifications({&wallet, [](CWallet*) {}});
2834

2935
const std::optional<std::string> address_mine{add_mine ? std::optional<std::string>{getnewaddress(wallet)} : std::nullopt};
3036
if (add_watchonly) importaddress(wallet, ADDRESS_WATCHONLY);

src/mapport.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,9 @@
55
#ifndef BITCOIN_MAPPORT_H
66
#define BITCOIN_MAPPORT_H
77

8-
#ifdef USE_UPNP
9-
static constexpr bool DEFAULT_UPNP = USE_UPNP;
10-
#else
118
static constexpr bool DEFAULT_UPNP = false;
12-
#endif // USE_UPNP
139

14-
#ifdef USE_NATPMP
15-
static constexpr bool DEFAULT_NATPMP = USE_NATPMP;
16-
#else
1710
static constexpr bool DEFAULT_NATPMP = false;
18-
#endif // USE_NATPMP
1911

2012
enum MapPortProtoFlag : unsigned int {
2113
NONE = 0x00,

src/net.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <net_permissions.h>
2121
#include <netaddress.h>
2222
#include <netbase.h>
23+
#include <protocol.h>
2324
#include <random.h>
2425
#include <scheduler.h>
2526
#include <ui_interface.h>
@@ -757,14 +758,14 @@ int CNode::GetSendVersion() const
757758
int V1TransportDeserializer::readHeader(Span<const uint8_t> msg_bytes)
758759
{
759760
// copy data to temporary parsing buffer
760-
unsigned int nRemaining = 24 - nHdrPos;
761+
unsigned int nRemaining = CMessageHeader::HEADER_SIZE - nHdrPos;
761762
unsigned int nCopy = std::min<unsigned int>(nRemaining, msg_bytes.size());
762763

763764
memcpy(&hdrbuf[nHdrPos], msg_bytes.data(), nCopy);
764765
nHdrPos += nCopy;
765766

766767
// if header incomplete, exit
767-
if (nHdrPos < 24)
768+
if (nHdrPos < CMessageHeader::HEADER_SIZE)
768769
return nCopy;
769770

770771
// deserialize to CMessageHeader

0 commit comments

Comments
 (0)