Skip to content

Commit c516eb0

Browse files
Merge pull request dashpay#5739 from knst/bp-v22-trivial
backport: trivial backports bitcoin v21-v22
2 parents 7b6c1be + ed48035 commit c516eb0

Some content is hidden

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

44 files changed

+298
-151
lines changed

configure.ac

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,6 @@ AC_ARG_ENABLE([gprof],
307307
[enable_gprof=$enableval],
308308
[enable_gprof=no])
309309

310-
dnl Pass compiler & linker flags that make builds deterministic
311-
AC_ARG_ENABLE([determinism],
312-
[AS_HELP_STRING([--enable-determinism],
313-
[Enable compilation flags that make builds deterministic (default is no)])],
314-
[enable_determinism=$enableval],
315-
[enable_determinism=no])
316-
317310
dnl Turn warnings into errors
318311
AC_ARG_ENABLE([werror],
319312
[AS_HELP_STRING([--enable-werror],
@@ -482,7 +475,9 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
482475
AX_CHECK_COMPILE_FLAG([-Wself-assign],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-self-assign"],,[[$CXXFLAG_WERROR]])
483476
AX_CHECK_COMPILE_FLAG([-Wunused-local-typedef],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-local-typedef"],,[[$CXXFLAG_WERROR]])
484477
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-implicit-fallthrough"],,[[$CXXFLAG_WERROR]])
485-
AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-deprecated-copy"],,[[$CXXFLAG_WERROR]])
478+
if test x$suppress_external_warnings != xyes ; then
479+
AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-deprecated-copy"],,[[$CXXFLAG_WERROR]])
480+
fi
486481
fi
487482

488483
dnl Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review.
@@ -964,12 +959,6 @@ if test x$TARGET_OS = xdarwin; then
964959
AX_CHECK_LINK_FLAG([[-Wl,-bind_at_load]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-bind_at_load"],, [[$LDFLAG_WERROR]])
965960
fi
966961

967-
if test x$enable_determinism = xyes; then
968-
if test x$TARGET_OS = xwindows; then
969-
AX_CHECK_LINK_FLAG([[-Wl,--no-insert-timestamp]], [LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"],, [[$LDFLAG_WERROR]])
970-
fi
971-
fi
972-
973962
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h])
974963

975964
AC_CHECK_DECLS([getifaddrs, freeifaddrs],[CHECK_SOCKET],,
@@ -981,6 +970,8 @@ AC_CHECK_DECLS([strnlen])
981970
dnl Check for daemon(3), unrelated to --with-daemon (although used by it)
982971
AC_CHECK_DECLS([daemon])
983972

973+
AC_CHECK_DECLS([pipe2])
974+
984975
AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,,
985976
[#if HAVE_ENDIAN_H
986977
#include <endian.h>
@@ -1185,6 +1176,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h>]],
11851176
[ AC_MSG_RESULT(yes); HAVE_O_CLOEXEC=1 ],
11861177
[ AC_MSG_RESULT(no); HAVE_O_CLOEXEC=0 ]
11871178
)
1179+
AC_DEFINE_UNQUOTED([HAVE_O_CLOEXEC], [$HAVE_O_CLOEXEC], [Define to 1 if O_CLOEXEC flag is available.])
11881180

11891181
dnl crc32c platform checks
11901182
AC_MSG_CHECKING(for __builtin_prefetch)
@@ -1348,13 +1340,15 @@ if test x$enable_wallet != xno; then
13481340
fi
13491341

13501342
if test x$use_ebpf != xno; then
1351-
AC_CHECK_HEADER([sys/sdt.h], [have_sdt=yes], [have_sdt=no])
1352-
else
1353-
have_sdt=no
1354-
fi
1355-
1356-
if test x$have_sdt = xyes; then
1357-
AC_DEFINE([ENABLE_TRACING], [1], [Define to 1 to enable eBPF user static defined tracepoints])
1343+
AC_MSG_CHECKING([whether eBPF tracepoints are supported])
1344+
AC_COMPILE_IFELSE([
1345+
AC_LANG_PROGRAM(
1346+
[#include <sys/sdt.h>],
1347+
[DTRACE_PROBE("context", "event");]
1348+
)],
1349+
[AC_MSG_RESULT(yes); have_sdt=yes; AC_DEFINE([ENABLE_TRACING], [1], [Define to 1 to enable eBPF user static defined tracepoints])],
1350+
[AC_MSG_RESULT(no); have_sdt=no;]
1351+
)
13581352
fi
13591353

13601354
dnl Check for libminiupnpc (optional)

depends/packages/native_mac_alias.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package=native_mac_alias
2-
$(package)_version=2.1.1
2+
$(package)_version=2.2.0
33
$(package)_download_path=https://github.com/al45tair/mac_alias/archive/
44
$(package)_file_name=v$($(package)_version).tar.gz
5-
$(package)_sha256_hash=c0ffceee14f7d04a6eb323fb7b8217dc3f373b346198d2ca42300a8362db7efa
5+
$(package)_sha256_hash=421e6d7586d1f155c7db3e7da01ca0dacc9649a509a253ad7077b70174426499
66
$(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages
77

88
define $(package)_build_cmds

src/coins.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bool CCoinsView::GetCoin(const COutPoint &outpoint, Coin &coin) const { return f
1313
uint256 CCoinsView::GetBestBlock() const { return uint256(); }
1414
std::vector<uint256> CCoinsView::GetHeadBlocks() const { return std::vector<uint256>(); }
1515
bool CCoinsView::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return false; }
16-
CCoinsViewCursor *CCoinsView::Cursor() const { return nullptr; }
16+
std::unique_ptr<CCoinsViewCursor> CCoinsView::Cursor() const { return nullptr; }
1717

1818
bool CCoinsView::HaveCoin(const COutPoint &outpoint) const
1919
{
@@ -28,7 +28,7 @@ uint256 CCoinsViewBacked::GetBestBlock() const { return base->GetBestBlock(); }
2828
std::vector<uint256> CCoinsViewBacked::GetHeadBlocks() const { return base->GetHeadBlocks(); }
2929
void CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; }
3030
bool CCoinsViewBacked::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return base->BatchWrite(mapCoins, hashBlock); }
31-
CCoinsViewCursor *CCoinsViewBacked::Cursor() const { return base->Cursor(); }
31+
std::unique_ptr<CCoinsViewCursor> CCoinsViewBacked::Cursor() const { return base->Cursor(); }
3232
size_t CCoinsViewBacked::EstimateSize() const { return base->EstimateSize(); }
3333

3434
CCoinsViewCache::CCoinsViewCache(CCoinsView *baseIn) : CCoinsViewBacked(baseIn), cachedCoinsUsage(0) {}

src/coins.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class CCoinsView
180180
virtual bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock);
181181

182182
//! Get a cursor to iterate over the whole state
183-
virtual CCoinsViewCursor *Cursor() const;
183+
virtual std::unique_ptr<CCoinsViewCursor> Cursor() const;
184184

185185
//! As we use CCoinsViews polymorphically, have a virtual destructor
186186
virtual ~CCoinsView() {}
@@ -204,7 +204,7 @@ class CCoinsViewBacked : public CCoinsView
204204
std::vector<uint256> GetHeadBlocks() const override;
205205
void SetBackend(CCoinsView &viewIn);
206206
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override;
207-
CCoinsViewCursor *Cursor() const override;
207+
std::unique_ptr<CCoinsViewCursor> Cursor() const override;
208208
size_t EstimateSize() const override;
209209
};
210210

@@ -237,7 +237,7 @@ class CCoinsViewCache : public CCoinsViewBacked
237237
uint256 GetBestBlock() const override;
238238
void SetBestBlock(const uint256 &hashBlock);
239239
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override;
240-
CCoinsViewCursor* Cursor() const override {
240+
std::unique_ptr<CCoinsViewCursor> Cursor() const override {
241241
throw std::logic_error("CCoinsViewCache cursor iteration not supported.");
242242
}
243243

src/flatfile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ size_t FlatFileSeq::Allocate(const FlatFilePos& pos, size_t add_size, bool& out_
6666
if (CheckDiskSpace(m_dir, inc_size)) {
6767
FILE *file = Open(pos);
6868
if (file) {
69-
LogPrintf("Pre-allocating up to position 0x%x in %s%05u.dat\n", new_size, m_prefix, pos.nFile);
69+
LogPrint(BCLog::VALIDATION, "Pre-allocating up to position 0x%x in %s%05u.dat\n", new_size, m_prefix, pos.nFile);
7070
AllocateFileRange(file, pos.nPos, inc_size);
7171
fclose(file);
7272
return inc_size;

src/net.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262

6363
#include <algorithm>
6464
#include <cstdint>
65+
#include <functional>
6566
#include <unordered_map>
6667

6768
#include <math.h>
@@ -2865,7 +2866,7 @@ void CConnman::ThreadI2PAcceptIncoming()
28652866
}
28662867

28672868
if (!advertising_listen_addr) {
2868-
AddLocal(conn.me, LOCAL_BIND);
2869+
AddLocal(conn.me, LOCAL_MANUAL);
28692870
advertising_listen_addr = true;
28702871
}
28712872

@@ -3049,8 +3050,9 @@ NodeId CConnman::GetNewNodeId()
30493050

30503051

30513052
bool CConnman::Bind(const CService &addr, unsigned int flags, NetPermissionFlags permissions) {
3052-
if (!(flags & BF_EXPLICIT) && !IsReachable(addr))
3053+
if (!(flags & BF_EXPLICIT) && !IsReachable(addr)) {
30533054
return false;
3055+
}
30543056
bilingual_str strError;
30553057
if (!BindListenPort(addr, strError, permissions)) {
30563058
if ((flags & BF_REPORT_ERROR) && clientInterface) {
@@ -3059,7 +3061,7 @@ bool CConnman::Bind(const CService &addr, unsigned int flags, NetPermissionFlags
30593061
return false;
30603062
}
30613063

3062-
if (addr.IsRoutable() && fDiscover && !(flags & BF_DONT_ADVERTISE) && !(permissions & PF_NOBAN)) {
3064+
if (addr.IsRoutable() && fDiscover && !(flags & BF_DONT_ADVERTISE) && !NetPermissions::HasFlag(permissions, NetPermissionFlags::PF_NOBAN)) {
30633065
AddLocal(addr, LOCAL_BIND);
30643066
}
30653067

src/net_permissions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@ class NetPermissions
5050
{
5151
flags = static_cast<NetPermissionFlags>(flags | f);
5252
}
53+
//! ClearFlag is only called with `f` == NetPermissionFlags::PF_ISIMPLICIT.
54+
//! If that should change in the future, be aware that ClearFlag should not
55+
//! be called with a subflag of a multiflag, e.g. NetPermissionFlags::PF_RELAY
56+
//! or NetPermissionFlags::PF_DOWNLOAD, as that would leave `flags` in an
57+
//! invalid state corresponding to none of the existing flags.
5358
static inline void ClearFlag(NetPermissionFlags& flags, NetPermissionFlags f)
5459
{
60+
assert(f == NetPermissionFlags::PF_ISIMPLICIT);
5561
flags = static_cast<NetPermissionFlags>(flags & ~f);
5662
}
5763
};

src/net_processing.cpp

100755100644
File mode changed.

src/qt/bitcoingui.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <qt/macdockiconhandler.h>
3131
#endif
3232

33+
#include <functional>
3334
#include <chain.h>
3435
#include <chainparams.h>
3536
#include <interfaces/handler.h>
@@ -903,6 +904,7 @@ void BitcoinGUI::removeWallet(WalletModel* walletModel)
903904
m_wallet_selector->removeItem(index);
904905
if (m_wallet_selector->count() == 0) {
905906
setWalletActionsEnabled(false);
907+
overviewButton->setChecked(true);
906908
} else if (m_wallet_selector->count() == 1) {
907909
m_wallet_selector_action->setVisible(false);
908910
}
@@ -1924,7 +1926,6 @@ void BitcoinGUI::showProgress(const QString &title, int nProgress)
19241926
progressDialog = new QProgressDialog(title, QString(), 0, 100, this);
19251927
GUIUtil::PolishProgressDialog(progressDialog);
19261928
progressDialog->setWindowModality(Qt::ApplicationModal);
1927-
progressDialog->setMinimumDuration(0);
19281929
progressDialog->setAutoClose(false);
19291930
progressDialog->setValue(0);
19301931
} else if (nProgress == 100) {

src/qt/clientmodel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <util/system.h>
2222

2323
#include <stdint.h>
24+
#include <functional>
2425

2526
#include <QDebug>
2627
#include <QThread>

0 commit comments

Comments
 (0)