Skip to content

Commit a78c28d

Browse files
2 parents 6723381 + 4293cbd commit a78c28d

File tree

15 files changed

+80
-41
lines changed

15 files changed

+80
-41
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ case $host in
691691
AC_MSG_ERROR("windres not found")
692692
fi
693693

694-
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D_WIN32_WINNT=0x0601"
694+
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D_WIN32_WINNT=0x0601 -D_WIN32_IE=0x0501 -DWIN32_LEAN_AND_MEAN"
695695

696696
dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against.
697697
dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override

doc/build-openbsd.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ OpenBSD build guide
22
======================
33
(updated for OpenBSD 6.2)
44

5-
This guide describes how to build dashd and command-line utilities on OpenBSD.
6-
7-
OpenBSD is most commonly used as a server OS, so this guide does not contain instructions for building the GUI.
5+
This guide describes how to build dashd, dash-qt, and command-line utilities on OpenBSD.
86

97
Preparation
108
-------------
@@ -13,6 +11,7 @@ Run the following as root to install the base dependencies for building:
1311

1412
```bash
1513
pkg_add git gmake libevent libtool
14+
pkg_add qt5 # (optional for enabling the GUI)
1615
pkg_add autoconf # (select highest version, e.g. 2.69)
1716
pkg_add automake # (select highest version, e.g. 1.15)
1817
pkg_add python # (select highest version, e.g. 3.6)
@@ -75,6 +74,14 @@ To configure without wallet:
7574
./configure --disable-wallet --with-gui=no CC=cc CXX=c++ MAKE=gmake
7675
```
7776

77+
To configure with GUI:
78+
```bash
79+
./configure --with-gui=yes CC=cc CXX=c++ \
80+
BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" \
81+
BDB_CFLAGS="-I${BDB_PREFIX}/include" \
82+
MAKE=gmake
83+
```
84+
7885
Build and run the tests:
7986
```bash
8087
gmake # use -jX here for parallelism

src/base58.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static const int8_t mapBase58[256] = {
3535
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
3636
};
3737

38-
bool DecodeBase58(const char* psz, std::vector<unsigned char>& vch, int max_ret_len)
38+
[[nodiscard]] static bool DecodeBase58(const char* psz, std::vector<unsigned char>& vch, int max_ret_len)
3939
{
4040
// Skip leading spaces.
4141
while (*psz && IsSpace(*psz))
@@ -141,7 +141,7 @@ std::string EncodeBase58Check(Span<const unsigned char> input)
141141
return EncodeBase58(vch);
142142
}
143143

144-
bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len)
144+
[[nodiscard]] static bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len)
145145
{
146146
if (!DecodeBase58(psz, vchRet, max_ret_len > std::numeric_limits<int>::max() - 4 ? std::numeric_limits<int>::max() : max_ret_len + 4) ||
147147
(vchRet.size() < 4)) {

src/base58.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@
2525
*/
2626
std::string EncodeBase58(Span<const unsigned char> input);
2727

28-
/**
29-
* Decode a base58-encoded string (psz) into a byte vector (vchRet).
30-
* return true if decoding is successful.
31-
* psz cannot be nullptr.
32-
*/
33-
[[nodiscard]] bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len);
34-
3528
/**
3629
* Decode a base58-encoded string (str) into a byte vector (vchRet).
3730
* return true if decoding is successful.
@@ -43,12 +36,6 @@ std::string EncodeBase58(Span<const unsigned char> input);
4336
*/
4437
std::string EncodeBase58Check(Span<const unsigned char> input);
4538

46-
/**
47-
* Decode a base58-encoded string (psz) that includes a checksum into a byte
48-
* vector (vchRet), return true if decoding is successful
49-
*/
50-
[[nodiscard]] bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len);
51-
5239
/**
5340
* Decode a base58-encoded string (str) that includes a checksum into a byte
5441
* vector (vchRet), return true if decoding is successful

src/chainparams.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ typedef std::map<int, uint256> MapCheckpoints;
2323

2424
struct CCheckpointData {
2525
MapCheckpoints mapCheckpoints;
26+
27+
int GetHeight() const {
28+
const auto& final_checkpoint = mapCheckpoints.rbegin();
29+
return final_checkpoint->first /* height */;
30+
}
2631
};
2732

2833
struct AssumeutxoHash : public BaseHash<uint256> {

src/compat.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#endif
1212

1313
#ifdef WIN32
14-
#ifndef WIN32_LEAN_AND_MEAN
15-
#define WIN32_LEAN_AND_MEAN 1
16-
#endif
1714
#ifndef NOMINMAX
1815
#define NOMINMAX
1916
#endif

src/init.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ void SetupServerArgs(NodeContext& node)
705705
argsman.AddArg("-checkblocks=<n>", strprintf("How many blocks to check at startup (default: %u, 0 = all)", DEFAULT_CHECKBLOCKS), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
706706
argsman.AddArg("-checklevel=<n>", strprintf("How thorough the block verification of -checkblocks is: %s (0-4, default: %u)", Join(CHECKLEVEL_DOC, ", "), DEFAULT_CHECKLEVEL), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
707707
argsman.AddArg("-checkmempool=<n>", strprintf("Run checks every <n> transactions (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
708-
argsman.AddArg("-checkpoints", strprintf("Enable rejection of any forks from the known historical chain until block 1450000 (default: %u)", DEFAULT_CHECKPOINTS_ENABLED), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
708+
argsman.AddArg("-checkpoints", strprintf("Enable rejection of any forks from the known historical chain until block %s (default: %u)", defaultChainParams->Checkpoints().GetHeight(), DEFAULT_CHECKPOINTS_ENABLED), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
709709
argsman.AddArg("-deprecatedrpc=<method>", "Allows deprecated RPC method(s) to be used", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
710710
argsman.AddArg("-limitancestorcount=<n>", strprintf("Do not accept transactions if number of in-mempool ancestors is <n> or more (default: %u)", DEFAULT_ANCESTOR_LIMIT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
711711
argsman.AddArg("-limitancestorsize=<n>", strprintf("Do not accept transactions whose size with all in-mempool ancestors exceeds <n> kilobytes (default: %u)", DEFAULT_ANCESTOR_SIZE_LIMIT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
@@ -1419,6 +1419,10 @@ bool AppInitParameterInteraction(const ArgsManager& args)
14191419

14201420
nMaxTipAge = args.GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE);
14211421

1422+
if (args.IsArgSet("-proxy") && args.GetArg("-proxy", "").empty()) {
1423+
return InitError(_("No proxy server specified. Use -proxy=<ip> or -proxy=<ip:port>."));
1424+
}
1425+
14221426
try {
14231427
const bool fRecoveryEnabled{llmq::utils::QuorumDataRecoveryEnabled()};
14241428
const bool fQuorumVvecRequestsEnabled{llmq::utils::GetEnabledQuorumVvecSyncEntries().size() > 0};

src/qt/guiutil.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
#include <cmath>
2828

2929
#ifdef WIN32
30-
#ifdef _WIN32_IE
31-
#undef _WIN32_IE
32-
#endif
33-
#define _WIN32_IE 0x0501
34-
#define WIN32_LEAN_AND_MEAN 1
3530
#ifndef NOMINMAX
3631
#define NOMINMAX
3732
#endif

src/support/lockedpool.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#endif
1111

1212
#ifdef WIN32
13-
#define WIN32_LEAN_AND_MEAN 1
1413
#ifndef NOMINMAX
1514
#define NOMINMAX
1615
#endif

src/util/system.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@
5252
#pragma warning(disable:4717)
5353
#endif
5454

55-
#ifdef _WIN32_IE
56-
#undef _WIN32_IE
57-
#endif
58-
#define _WIN32_IE 0x0501
59-
60-
#define WIN32_LEAN_AND_MEAN 1
6155
#ifndef NOMINMAX
6256
#define NOMINMAX
6357
#endif

0 commit comments

Comments
 (0)