Compare commits

...

8 Commits

Author SHA1 Message Date
sami7777 61f22fcfd4 Fix display version string to match 5.3.2
Build All Platforms / build-windows-qt (push) Waiting to run
Build All Platforms / build-windows-daemon (push) Waiting to run
Build All Platforms / build-linux-qt (push) Waiting to run
Build All Platforms / build-linux-daemon (push) Waiting to run
Build All Platforms / build-macos (push) Waiting to run
Build All Platforms / release (push) Blocked by required conditions
DISPLAY_VERSION_REVISION in version.h was still set to 1, causing the
internal version string to show v5.3.1.0 instead of v5.3.2.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 14:52:44 -07:00
sami7777 bf1bf393c8 Bump version to 5.3.2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 14:18:06 -07:00
sami7777 39e244a11c Fix build: random_shuffle removal, Windows daemon missing objects
- Replace random_shuffle (removed in C++17) with std::shuffle in wallet.cpp
- Add -std=c++17 to makefile.mingw (Windows daemon was missing it)
- Add lz4.o, tor_embed_hooks.o, tor_embedded.o to makefile.mingw OBJS
- Add build rules for new objects in makefile.mingw
- Simplify Tor embedded build to use aggregate libtor.a

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 13:47:42 -07:00
sami7777 6724dfc832 Fix build: revert shared_ptr in RPC, replace auto_ptr with unique_ptr
- trianglesrpc.cpp: revert std::shared_ptr back to boost::shared_ptr
  (boost::signals2::slot::track() requires boost::shared_ptr)
- miner.cpp: auto_ptr → unique_ptr (auto_ptr removed in C++17,
  caught by macOS clang)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 13:34:16 -07:00
sami7777 9dadba6b09 Fix build: tuple access syntax, namespace, LZ4 separate compilation
- miner.cpp: .get<N>() → std::get<N>() (boost::tuple member syntax
  doesn't exist on std::tuple)
- script.cpp: remove 'using namespace boost' (no boost headers left)
- smessage.cpp: include lz4/lz4.h instead of lz4/lz4.c (U64 typedef
  conflict with xxhash when LZ4 1.10.0 source included in same TU)
- makefile.unix: add obj/lz4.o as separate compilation unit
- triangles-qt.pro: add src/lz4/lz4.c to SOURCES

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 02:46:37 -07:00
sami7777 c432817d5f Bump version to 5.3.1
Build All Platforms / build-windows-qt (push) Waiting to run
Build All Platforms / build-windows-daemon (push) Waiting to run
Build All Platforms / build-linux-qt (push) Waiting to run
Build All Platforms / build-linux-daemon (push) Waiting to run
Build All Platforms / build-macos (push) Waiting to run
Build All Platforms / release (push) Blocked by required conditions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 02:36:12 -07:00
sami7777 7ceb1f6a4d Replace boost with C++17 std equivalents, upgrade LZ4 to 1.10.0
- boost::tuple → std::tuple (serialize.h, miner.cpp, script.cpp, walletdb.cpp)
- boost::shared_ptr → std::shared_ptr (trianglesrpc.cpp)
- boost::variant → std::variant for CTxDestination (script.h)
- boost::get → std::get_if (main.cpp, rpcblockchain.cpp, coincontroldialog.cpp, wallet.cpp)
- boost::apply_visitor → std::visit (base58.h, script.cpp, rpcwallet.cpp, test/base58_tests.cpp)
- boost::static_visitor removed from all visitor classes
- boost::lexical_cast → std::to_string/std::stoll (smessage.cpp, rpcsmessage.cpp)
- Removed unused boost/lexical_cast.hpp includes (rest.cpp, trianglesrpc.cpp)
- Removed boost/variant/get.hpp include (rpcdump.cpp)
- Upgraded vendored LZ4 from 1.1.3 to 1.10.0
- Updated LZ4_compress() → LZ4_compress_default() (smessage.cpp)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 02:31:23 -07:00
sami7777 1a2793bb88 Fix build: replace remaining list_of calls, remove register keyword
- Replace boost::assign::list_of/map_list_of with brace-init in
  rpcrawtransaction.cpp (7 call sites missed in previous commit)
- Remove C++17-banned 'register' keyword from lz4.c (macOS build fix)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 02:07:49 -07:00
30 changed files with 3570 additions and 969 deletions
+21 -26
View File
@@ -11,7 +11,7 @@ trianglesd / triangles-qt
├── tor_embedded.cpp ← calls tor_run_main() in a background thread
├── tor_process.cpp ← fallback: launches external tor binary (already works)
├── onion_v3.cpp ← V3 onion address generation / SOCKS5 proxy logic
└── libtor.a ← static Tor library (built from official source)
└── libtor.a ← aggregate static Tor library (built from official source)
```
When compiled with `ENABLE_TOR_EMBEDDED`, the wallet calls `tor_run_main()` from
@@ -34,7 +34,7 @@ This puts the full Tor source at `src/tor/tor-src/`.
Current imported checkout in this repo: `release-0.4.9` at commit `1442ca4`.
There is also a helper build script at `src/tor/build-libtor.sh`.
## Step 2: Build libtor.a (Linux)
## Step 2: Build libtor.a
Tor uses autotools. Build it as a static library:
@@ -71,10 +71,9 @@ Or from the repo root:
./src/tor/build-libtor.sh
```
After building, the static libraries are in `src/tor/tor-src/src/`:
- `src/core/libtor-app.a`
After building, the static libraries are in `src/tor/tor-src/`:
- `libtor.a`
- `src/lib/libtor-*.a` (multiple component libs)
- `src/trunnel/libor-trunnel.a`
The header `src/feature/api/tor_api.h` provides the public C API:
```c
@@ -98,22 +97,14 @@ make -f makefile.unix \
```
You may need to adjust the `-l` flags in the makefile depending on the exact
library names Tor produces. Check `src/tor/tor-src/src/` after building:
library names Tor produces. Check `src/tor/tor-src/` after building:
```bash
find tor/tor-src/src -name '*.a' | sort
find tor/tor-src -name '*.a' | sort
```
Common libraries to link (order matters):
```
-ltor-app -lor -lor-ctime -lor-evloop -lor-event -lor-compress
-lor-container -lor-crypt-ops -lor-encoding -lor-err -lor-fs
-lor-intmath -lor-lock -lor-log -lor-malloc -lor-math -lor-memarea
-lor-meminfo -lor-net -lor-osinfo -lor-process -lor-sandbox
-lor-smartlist-core -lor-string -lor-term -lor-thread -lor-time
-lor-tls -lor-trace -lor-version -lor-wallclock
-lor-trunnel
```
On the imported `release-0.4.9` checkout in this repo, the simplest working
link path is the aggregate `libtor.a` plus the normal dependency libraries.
### Windows (triangles-qt.pro)
@@ -126,9 +117,14 @@ qmake "USE_TOR_EMBEDDED=1" \
Both build systems now default to:
- source root: `src/tor/tor-src`
- include path: `src/tor/tor-src/src/feature/api`
- library paths: `src/tor/tor-src/src/core`, `src/tor/tor-src/src/lib`, `src/tor/tor-src/src/trunnel`
- library path: `src/tor/tor-src`
- embedded Tor library: `-ltor`
Override `TOR_EMBEDDED_LIBS` if the actual Tor static library names differ on your platform/build.
On Windows, the imported Tor `0.4.9.5` build also needed:
- `-llzma`
- `-lzstd`
- `-liphlpapi`
- `-lshlwapi` (already linked by Triangles)
## Step 4: Wire into init.cpp
@@ -182,10 +178,9 @@ The embedded Tor respects these command-line flags:
src/tor/
├── tor-src/ ← git submodule (official Tor repo)
│ └── src/
│ ├── core/libtor-app.a
│ ├── lib/libor-*.a
│ ├── trunnel/libor-trunnel.a
│ ├── lib/libtor-*.a
│ └── feature/api/tor_api.h
│ └── libtor.a
├── tor_embedded.h ← CTorEmbedded class header
├── tor_embedded.cpp ← implementation (calls tor_run_main)
├── tor_process.h ← external Tor process manager (fallback)
@@ -213,11 +208,11 @@ object instead of raw `tor_main(int argc, char** argv)`.
**Tor fails to bootstrap**: Check firewall rules. Tor needs outbound TCP to the
Tor network (ports 80, 443, 9001, 9030).
**Link errors with libtor**: The Tor static libraries must be linked in
dependency order. If you get undefined symbols, reorder the `-l` flags or use
`-Wl,--start-group ... -Wl,--end-group` to resolve circular deps:
**Link errors with libtor**: Prefer the aggregate `libtor.a` from the top level
of the Tor build tree. On the imported Windows/MSYS2 build in this repo, the
minimal verified link set was:
```
LIBS += -Wl,--start-group -ltor-app -lor -lor-ctime ... -Wl,--end-group
-ltor -levent -lssl -lcrypto -lz -llzma -lzstd -lws2_32 -liphlpapi -lshlwapi
```
**OpenSSL version mismatch**: Both Tor and Triangles must link against the same
+2 -2
View File
@@ -260,7 +260,7 @@ public:
* The data vector contains RIPEMD160(SHA256(cscript)), where cscript is the serialized redemption script.
*/
class CTrianglesAddress;
class CTrianglesAddressVisitor : public boost::static_visitor<bool>
class CTrianglesAddressVisitor
{
private:
CTrianglesAddress *addr;
@@ -294,7 +294,7 @@ public:
bool Set(const CTxDestination &dest)
{
return boost::apply_visitor(CTrianglesAddressVisitor(this), dest);
return std::visit(CTrianglesAddressVisitor(this), dest);
}
bool IsValid() const
+1 -1
View File
@@ -8,7 +8,7 @@
// These need to be macros, as version.cpp's and triangles-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 5
#define CLIENT_VERSION_MINOR 3
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_REVISION 2
#define CLIENT_VERSION_BUILD 0
// Converts the parameter X to a string after macro replacement on X has been performed.
+2 -2
View File
@@ -18,8 +18,8 @@
#include <stdexcept>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/variant.hpp>
namespace json_spirit
{
+10 -22
View File
@@ -1,24 +1,12 @@
LZ4 Library
Copyright (c) 2011-2014, Yann Collet
All rights reserved.
This repository uses 2 different licenses :
- all files in the `lib` directory use a BSD 2-Clause license
- all other files use a GPL-2.0-or-later license, unless explicitly stated otherwise
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Relevant license is reminded at the top of each source file,
and with presence of COPYING or LICENSE file in associated directories.
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This model is selected to emphasize that
files in the `lib` directory are designed to be included into 3rd party applications,
while all other files, in `programs`, `tests` or `examples`,
are intended to be used "as is", as part of their intended scenarios,
with no intention to support 3rd party integration use cases.
+2571 -622
View File
File diff suppressed because it is too large Load Diff
+808 -172
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1526,14 +1526,14 @@ static bool GetAddressFromScript(const CScript& script, int& nType, uint160& has
if (!ExtractDestination(script, dest))
return false;
const CKeyID* keyId = boost::get<CKeyID>(&dest);
const CKeyID* keyId = std::get_if<CKeyID>(&dest);
if (keyId) {
nType = ADDR_TYPE_P2PKH;
hashBytes = *keyId;
return true;
}
const CScriptID* scriptId = boost::get<CScriptID>(&dest);
const CScriptID* scriptId = std::get_if<CScriptID>(&dest);
if (scriptId) {
nType = ADDR_TYPE_P2SH;
hashBytes = *scriptId;
+26 -2
View File
@@ -74,7 +74,7 @@ HARDENING+=-D_FORTIFY_SOURCE=2
DEBUGFLAGS=-g
xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter \
xCXXFLAGS=-O2 -std=c++17 -pthread -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter \
-Wno-deprecated-declarations -Wno-reserved-user-defined-literal \
-Wa,-mbig-obj \
$(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
@@ -135,8 +135,11 @@ OBJS= \
obj/scrypt-x86.o \
obj/scrypt-x86_64.o \
obj/smessage.o \
obj/lz4.o \
obj/onion_v3.o \
obj/tor_process.o
obj/tor_process.o \
obj/tor_embed_hooks.o \
obj/tor_embedded.o
all: trianglesd.exe
@@ -208,6 +211,27 @@ obj/tor_process.o: tor/tor_process.cpp
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
obj/lz4.o: lz4/lz4.c
$(CXX) -c $(xCXXFLAGS) -fpermissive -MMD -MF $(@:%.o=%.d) -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
obj/tor_embed_hooks.o: tor_embed_hooks.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
obj/tor_embedded.o: tor/tor_embedded.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
obj/net_bootstrap.o: net_bootstrap.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
+12 -4
View File
@@ -170,24 +170,25 @@ OBJS= \
obj/scrypt-x86.o \
obj/scrypt-x86_64.o \
obj/smessage.o \
obj/lz4.o \
obj/onion_v3.o \
obj/tor_process.o \
obj/tor_embed_hooks.o \
obj/tor_embedded.o
# Embedded Tor support (optional)
# Build with: make -f makefile.unix USE_TOR_EMBEDDED=1 TOR_LIB_PATH=/path/to/libtor
# Build with: make -f makefile.unix USE_TOR_EMBEDDED=1 TOR_SOURCE_ROOT=/path/to/tor-src
# Requires libtor.a built from official Tor source (see CODEX-TOR-GUIDE.md)
TOR_SOURCE_ROOT ?= tor/tor-src
TOR_INCLUDE_PATH ?= $(TOR_SOURCE_ROOT)/src/feature/api
TOR_LIB_PATH ?= $(TOR_SOURCE_ROOT)/src/core $(TOR_SOURCE_ROOT)/src/lib $(TOR_SOURCE_ROOT)/src/trunnel
TOR_EMBEDDED_LIBS ?= -ltor-app -lor -lor-ctime -lor-event -lor-trunnel
TOR_LIB_PATH ?= $(TOR_SOURCE_ROOT)
TOR_EMBEDDED_LIBS ?= -ltor
ifdef USE_TOR_EMBEDDED
DEFS += -DENABLE_TOR_EMBEDDED
DEFS += $(addprefix -I,$(TOR_INCLUDE_PATH))
LIBS += $(addprefix -L,$(TOR_LIB_PATH))
LIBS += -Wl,--start-group $(TOR_EMBEDDED_LIBS) -Wl,--end-group
LIBS += -levent -levent_pthreads -lssl -lcrypto -lz -lm -lpthread
LIBS += -llzma -lzstd -lm -lpthread
endif
# ZMQ support (optional)
@@ -243,6 +244,13 @@ obj/%.o: %.c
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
obj/lz4.o: lz4/lz4.c
$(CXX) -c $(xCXXFLAGS) -fpermissive -MMD -MF $(@:%.o=%.d) -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//'\
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
obj/tor_embed_hooks.o: tor_embed_hooks.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
+12 -12
View File
@@ -83,7 +83,7 @@ uint64_t nLastBlockSize = 0;
int64_t nLastCoinStakeSearchInterval = 0;
// We want to sort transactions by priority and fee, so:
typedef boost::tuple<double, double, CTransaction*> TxPriority;
typedef std::tuple<double, double, CTransaction*> TxPriority;
class TxPriorityCompare
{
bool byFee;
@@ -93,15 +93,15 @@ public:
{
if (byFee)
{
if (a.get<1>() == b.get<1>())
return a.get<0>() < b.get<0>();
return a.get<1>() < b.get<1>();
if (std::get<1>(a) == std::get<1>(b))
return std::get<0>(a) < std::get<0>(b);
return std::get<1>(a) < std::get<1>(b);
}
else
{
if (a.get<0>() == b.get<0>())
return a.get<1>() < b.get<1>();
return a.get<0>() < b.get<0>();
if (std::get<0>(a) == std::get<0>(b))
return std::get<1>(a) < std::get<1>(b);
return std::get<0>(a) < std::get<0>(b);
}
}
};
@@ -110,7 +110,7 @@ public:
CBlock* CreateNewBlock(CWallet* pwallet, bool fProofOfStake, int64_t* pFees)
{
// Create new block
auto_ptr<CBlock> pblock(new CBlock());
unique_ptr<CBlock> pblock(new CBlock());
if (!pblock.get())
return NULL;
@@ -259,9 +259,9 @@ CBlock* CreateNewBlock(CWallet* pwallet, bool fProofOfStake, int64_t* pFees)
while (!vecPriority.empty())
{
// Take highest priority transaction off the priority queue:
double dPriority = vecPriority.front().get<0>();
double dFeePerKb = vecPriority.front().get<1>();
CTransaction& tx = *(vecPriority.front().get<2>());
double dPriority = std::get<0>(vecPriority.front());
double dFeePerKb = std::get<1>(vecPriority.front());
CTransaction& tx = *(std::get<2>(vecPriority.front()));
std::pop_heap(vecPriority.begin(), vecPriority.end(), comparer);
vecPriority.pop_back();
@@ -562,7 +562,7 @@ void StakeMiner(CWallet *pwallet)
// Create new block
//
int64_t nFees;
auto_ptr<CBlock> pblock(CreateNewBlock(pwallet, true, &nFees));
unique_ptr<CBlock> pblock(CreateNewBlock(pwallet, true, &nFees));
if (!pblock.get())
return;
+2 -2
View File
@@ -522,7 +522,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
if(ExtractDestination(out.tx->vout[out.i].scriptPubKey, address))
{
CPubKey pubkey;
CKeyID *keyid = boost::get< CKeyID >(&address);
CKeyID *keyid = std::get_if< CKeyID >(&address);
if (keyid && model->getPubKey(*keyid, pubkey))
nBytesInputs += (pubkey.IsCompressed() ? 148 : 180);
else
@@ -703,7 +703,7 @@ void CoinControlDialog::updateView()
itemOutput->setText(COLUMN_ADDRESS, sAddress);
CPubKey pubkey;
CKeyID *keyid = boost::get< CKeyID >(&outputAddress);
CKeyID *keyid = std::get_if< CKeyID >(&outputAddress);
if (keyid && model->getPubKey(*keyid, pubkey) && !pubkey.IsCompressed())
nInputSize = 180;
}
-1
View File
@@ -13,7 +13,6 @@
#include "init.h"
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
using namespace std;
using namespace json_spirit;
+2 -2
View File
@@ -431,13 +431,13 @@ static bool ParseAddress(const std::string& strAddr, int& nType, uint160& hashBy
return false;
CTxDestination dest = addr.Get();
const CKeyID* keyId = boost::get<CKeyID>(&dest);
const CKeyID* keyId = std::get_if<CKeyID>(&dest);
if (keyId) {
nType = ADDR_TYPE_P2PKH;
hashBytes = *keyId;
return true;
}
const CScriptID* scriptId = boost::get<CScriptID>(&dest);
const CScriptID* scriptId = std::get_if<CScriptID>(&dest);
if (scriptId) {
nType = ADDR_TYPE_P2SH;
hashBytes = *scriptId;
-1
View File
@@ -11,7 +11,6 @@
#include "base58.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/variant/get.hpp>
#include <boost/algorithm/string.hpp>
#define printf OutputDebugStringF
+7 -7
View File
@@ -145,7 +145,7 @@ Value listunspent(const Array& params, bool fHelp)
"Results are an array of Objects, each of which has:\n"
"{txid, vout, scriptPubKey, amount, confirmations}");
RPCTypeCheck(params, list_of(int_type)(int_type)(array_type));
RPCTypeCheck(params, {int_type, int_type, array_type});
int nMinDepth = 1;
if (params.size() > 0)
@@ -221,7 +221,7 @@ Value createrawtransaction(const Array& params, bool fHelp)
"Note that the transaction's inputs are not signed, and\n"
"it is not stored in the wallet or transmitted to the network.");
RPCTypeCheck(params, list_of(array_type)(obj_type));
RPCTypeCheck(params, {array_type, obj_type});
Array inputs = params[0].get_array();
Object sendTo = params[1].get_obj();
@@ -281,7 +281,7 @@ Value decoderawtransaction(const Array& params, bool fHelp)
"decoderawtransaction <hex string>\n"
"Return a JSON object representing the serialized, hex-encoded transaction.");
RPCTypeCheck(params, list_of(str_type));
RPCTypeCheck(params, {str_type});
vector<unsigned char> txData(ParseHex(params[0].get_str()));
CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION);
@@ -306,7 +306,7 @@ Value decodescript(const Array& params, bool fHelp)
"decodescript <hex string>\n"
"Decode a hex-encoded script.");
RPCTypeCheck(params, list_of(str_type));
RPCTypeCheck(params, {str_type});
Object r;
CScript script;
@@ -339,7 +339,7 @@ Value signrawtransaction(const Array& params, bool fHelp)
" complete : 1 if transaction has a complete set of signature (0 if not)"
+ HelpRequiringPassphrase());
RPCTypeCheck(params, list_of(str_type)(array_type)(array_type)(str_type), true);
RPCTypeCheck(params, {str_type, array_type, array_type, str_type}, true);
vector<unsigned char> txData(ParseHex(params[0].get_str()));
CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION);
@@ -398,7 +398,7 @@ Value signrawtransaction(const Array& params, bool fHelp)
Object prevOut = p.get_obj();
RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type));
RPCTypeCheck(prevOut, {{"txid", str_type}, {"vout", int_type}, {"scriptPubKey", str_type}});
string txidHex = find_value(prevOut, "txid").get_str();
if (!IsHex(txidHex))
@@ -518,7 +518,7 @@ Value sendrawtransaction(const Array& params, bool fHelp)
"sendrawtransaction <hex string>\n"
"Submits raw transaction (serialized, hex-encoded) to local node and network.");
RPCTypeCheck(params, list_of(str_type));
RPCTypeCheck(params, {str_type});
// parse hex string from parameter
vector<unsigned char> txData(ParseHex(params[0].get_str()));
+6 -6
View File
@@ -5,7 +5,7 @@
#include "main.h"
#include "trianglesrpc.h"
#include <boost/lexical_cast.hpp>
#include <string>
#include "smessage.h"
#include "init.h" // pwalletMain
@@ -802,13 +802,13 @@ Value smsgbuckets(const Array& params, bool fHelp)
{
std::set<SecMsgToken>& tokenSet = it->second.setTokens;
std::string sBucket = boost::lexical_cast<std::string>(it->first);
std::string sBucket = std::to_string(it->first);
std::string sFile = sBucket + "_01.dat";
snprintf(cbuf, sizeof(cbuf), "%"PRIszu, tokenSet.size());
std::string snContents(cbuf);
std::string sHash = boost::lexical_cast<std::string>(it->second.hash);
std::string sHash = std::to_string(it->second.hash);
nBuckets++;
nMessages += tokenSet.size();
@@ -849,8 +849,8 @@ Value smsgbuckets(const Array& params, bool fHelp)
}; // LOCK(cs_smsg);
std::string snBuckets = boost::lexical_cast<std::string>(nBuckets);
std::string snMessages = boost::lexical_cast<std::string>(nMessages);
std::string snBuckets = std::to_string(nBuckets);
std::string snMessages = std::to_string(nMessages);
Object objM;
objM.push_back(Pair("buckets", snBuckets));
@@ -868,7 +868,7 @@ Value smsgbuckets(const Array& params, bool fHelp)
for (it = smsgBuckets.begin(); it != smsgBuckets.end(); ++it)
{
std::string sFile = boost::lexical_cast<std::string>(it->first) + "_01.dat";
std::string sFile = std::to_string(it->first) + "_01.dat";
try {
boost::filesystem::path fullPath = GetDataDir() / "smsgStore" / sFile;
+3 -3
View File
@@ -1587,7 +1587,7 @@ Value encryptwallet(const Array& params, bool fHelp)
return "wallet encrypted; Triangles server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
}
class DescribeAddressVisitor : public boost::static_visitor<Object>
class DescribeAddressVisitor
{
public:
Object operator()(const CNoDestination &dest) const { return Object(); }
@@ -1644,7 +1644,7 @@ Value validateaddress(const Array& params, bool fHelp)
bool fMine = IsMine(*pwalletMain, dest);
ret.push_back(Pair("ismine", fMine));
if (fMine) {
Object detail = boost::apply_visitor(DescribeAddressVisitor(), dest);
Object detail = std::visit(DescribeAddressVisitor(), dest);
ret.insert(ret.end(), detail.begin(), detail.end());
}
if (pwalletMain->mapAddressBook.count(dest))
@@ -1681,7 +1681,7 @@ Value validatepubkey(const Array& params, bool fHelp)
ret.push_back(Pair("ismine", fMine));
ret.push_back(Pair("iscompressed", isCompressed));
if (fMine) {
Object detail = boost::apply_visitor(DescribeAddressVisitor(), dest);
Object detail = std::visit(DescribeAddressVisitor(), dest);
ret.insert(ret.end(), detail.begin(), detail.end());
}
if (pwalletMain->mapAddressBook.count(dest))
+8 -10
View File
@@ -3,11 +3,9 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <tuple>
using namespace std;
using namespace boost;
#include "script.h"
#include "keystore.h"
@@ -1213,7 +1211,7 @@ class CSignatureCache
{
private:
// sigdata_type is (signature hash, signature, public key):
typedef boost::tuple<uint256, std::vector<unsigned char>, std::vector<unsigned char> > sigdata_type;
typedef std::tuple<uint256, std::vector<unsigned char>, std::vector<unsigned char> > sigdata_type;
std::set< sigdata_type> setValid;
CCriticalSection cs_sigcache;
@@ -1542,7 +1540,7 @@ unsigned int HaveKeys(const vector<valtype>& pubkeys, const CKeyStore& keystore)
}
class CKeyStoreIsMineVisitor : public boost::static_visitor<bool>
class CKeyStoreIsMineVisitor
{
private:
const CKeyStore *keystore;
@@ -1555,7 +1553,7 @@ public:
bool IsMine(const CKeyStore &keystore, const CTxDestination &dest)
{
return boost::apply_visitor(CKeyStoreIsMineVisitor(&keystore), dest);
return std::visit(CKeyStoreIsMineVisitor(&keystore), dest);
}
bool IsMine(const CKeyStore &keystore, const CScript& scriptPubKey)
@@ -1623,7 +1621,7 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)
return false;
}
class CAffectedKeysVisitor : public boost::static_visitor<void> {
class CAffectedKeysVisitor {
private:
const CKeyStore &keystore;
std::vector<CKeyID> &vKeys;
@@ -1637,7 +1635,7 @@ public:
int nRequired;
if (ExtractDestinations(script, type, vDest, nRequired)) {
for (const CTxDestination &dest : vDest)
boost::apply_visitor(*this, dest);
std::visit(*this, dest);
}
}
@@ -1994,7 +1992,7 @@ bool CScript::HasCanonicalPushes() const
return true;
}
class CScriptVisitor : public boost::static_visitor<bool>
class CScriptVisitor
{
private:
CScript *script;
@@ -2022,7 +2020,7 @@ public:
void CScript::SetDestination(const CTxDestination& dest)
{
boost::apply_visitor(CScriptVisitor(this), dest);
std::visit(CScriptVisitor(this), dest);
}
void CScript::SetMultisig(int nRequired, const std::vector<CKey>& keys)
+2 -2
View File
@@ -11,7 +11,7 @@
#include <stdint.h>
#include <boost/variant.hpp>
#include <variant>
#include "keystore.h"
#include "bignum.h"
@@ -52,7 +52,7 @@ public:
* * CScriptID: TX_SCRIPTHASH destination
* A CTxDestination is the internal data type encoded in a CTrianglesAddress
*/
typedef boost::variant<CNoDestination, CKeyID, CScriptID> CTxDestination;
typedef std::variant<CNoDestination, CKeyID, CScriptID> CTxDestination;
const char* GetTxnOutputType(txnouttype t);
+34 -36
View File
@@ -17,9 +17,7 @@
#include <cstdio>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/tuple/tuple_io.hpp>
#include <tuple>
#include "allocators.h"
#include "version.h"
@@ -310,14 +308,14 @@ template<typename Stream, typename K, typename T> void Serialize(Stream& os, con
template<typename Stream, typename K, typename T> void Unserialize(Stream& is, std::pair<K, T>& item, int nType, int nVersion);
// 3 tuple
template<typename T0, typename T1, typename T2> unsigned int GetSerializeSize(const boost::tuple<T0, T1, T2>& item, int nType, int nVersion);
template<typename Stream, typename T0, typename T1, typename T2> void Serialize(Stream& os, const boost::tuple<T0, T1, T2>& item, int nType, int nVersion);
template<typename Stream, typename T0, typename T1, typename T2> void Unserialize(Stream& is, boost::tuple<T0, T1, T2>& item, int nType, int nVersion);
template<typename T0, typename T1, typename T2> unsigned int GetSerializeSize(const std::tuple<T0, T1, T2>& item, int nType, int nVersion);
template<typename Stream, typename T0, typename T1, typename T2> void Serialize(Stream& os, const std::tuple<T0, T1, T2>& item, int nType, int nVersion);
template<typename Stream, typename T0, typename T1, typename T2> void Unserialize(Stream& is, std::tuple<T0, T1, T2>& item, int nType, int nVersion);
// 4 tuple
template<typename T0, typename T1, typename T2, typename T3> unsigned int GetSerializeSize(const boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion);
template<typename Stream, typename T0, typename T1, typename T2, typename T3> void Serialize(Stream& os, const boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion);
template<typename Stream, typename T0, typename T1, typename T2, typename T3> void Unserialize(Stream& is, boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion);
template<typename T0, typename T1, typename T2, typename T3> unsigned int GetSerializeSize(const std::tuple<T0, T1, T2, T3>& item, int nType, int nVersion);
template<typename Stream, typename T0, typename T1, typename T2, typename T3> void Serialize(Stream& os, const std::tuple<T0, T1, T2, T3>& item, int nType, int nVersion);
template<typename Stream, typename T0, typename T1, typename T2, typename T3> void Unserialize(Stream& is, std::tuple<T0, T1, T2, T3>& item, int nType, int nVersion);
// map
template<typename K, typename T, typename Pred, typename A> unsigned int GetSerializeSize(const std::map<K, T, Pred, A>& m, int nType, int nVersion);
@@ -530,29 +528,29 @@ void Unserialize(Stream& is, std::pair<K, T>& item, int nType, int nVersion)
// 3 tuple
//
template<typename T0, typename T1, typename T2>
unsigned int GetSerializeSize(const boost::tuple<T0, T1, T2>& item, int nType, int nVersion)
unsigned int GetSerializeSize(const std::tuple<T0, T1, T2>& item, int nType, int nVersion)
{
unsigned int nSize = 0;
nSize += GetSerializeSize(boost::get<0>(item), nType, nVersion);
nSize += GetSerializeSize(boost::get<1>(item), nType, nVersion);
nSize += GetSerializeSize(boost::get<2>(item), nType, nVersion);
nSize += GetSerializeSize(std::get<0>(item), nType, nVersion);
nSize += GetSerializeSize(std::get<1>(item), nType, nVersion);
nSize += GetSerializeSize(std::get<2>(item), nType, nVersion);
return nSize;
}
template<typename Stream, typename T0, typename T1, typename T2>
void Serialize(Stream& os, const boost::tuple<T0, T1, T2>& item, int nType, int nVersion)
void Serialize(Stream& os, const std::tuple<T0, T1, T2>& item, int nType, int nVersion)
{
Serialize(os, boost::get<0>(item), nType, nVersion);
Serialize(os, boost::get<1>(item), nType, nVersion);
Serialize(os, boost::get<2>(item), nType, nVersion);
Serialize(os, std::get<0>(item), nType, nVersion);
Serialize(os, std::get<1>(item), nType, nVersion);
Serialize(os, std::get<2>(item), nType, nVersion);
}
template<typename Stream, typename T0, typename T1, typename T2>
void Unserialize(Stream& is, boost::tuple<T0, T1, T2>& item, int nType, int nVersion)
void Unserialize(Stream& is, std::tuple<T0, T1, T2>& item, int nType, int nVersion)
{
Unserialize(is, boost::get<0>(item), nType, nVersion);
Unserialize(is, boost::get<1>(item), nType, nVersion);
Unserialize(is, boost::get<2>(item), nType, nVersion);
Unserialize(is, std::get<0>(item), nType, nVersion);
Unserialize(is, std::get<1>(item), nType, nVersion);
Unserialize(is, std::get<2>(item), nType, nVersion);
}
@@ -561,32 +559,32 @@ void Unserialize(Stream& is, boost::tuple<T0, T1, T2>& item, int nType, int nVer
// 4 tuple
//
template<typename T0, typename T1, typename T2, typename T3>
unsigned int GetSerializeSize(const boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
unsigned int GetSerializeSize(const std::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
{
unsigned int nSize = 0;
nSize += GetSerializeSize(boost::get<0>(item), nType, nVersion);
nSize += GetSerializeSize(boost::get<1>(item), nType, nVersion);
nSize += GetSerializeSize(boost::get<2>(item), nType, nVersion);
nSize += GetSerializeSize(boost::get<3>(item), nType, nVersion);
nSize += GetSerializeSize(std::get<0>(item), nType, nVersion);
nSize += GetSerializeSize(std::get<1>(item), nType, nVersion);
nSize += GetSerializeSize(std::get<2>(item), nType, nVersion);
nSize += GetSerializeSize(std::get<3>(item), nType, nVersion);
return nSize;
}
template<typename Stream, typename T0, typename T1, typename T2, typename T3>
void Serialize(Stream& os, const boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
void Serialize(Stream& os, const std::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
{
Serialize(os, boost::get<0>(item), nType, nVersion);
Serialize(os, boost::get<1>(item), nType, nVersion);
Serialize(os, boost::get<2>(item), nType, nVersion);
Serialize(os, boost::get<3>(item), nType, nVersion);
Serialize(os, std::get<0>(item), nType, nVersion);
Serialize(os, std::get<1>(item), nType, nVersion);
Serialize(os, std::get<2>(item), nType, nVersion);
Serialize(os, std::get<3>(item), nType, nVersion);
}
template<typename Stream, typename T0, typename T1, typename T2, typename T3>
void Unserialize(Stream& is, boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
void Unserialize(Stream& is, std::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
{
Unserialize(is, boost::get<0>(item), nType, nVersion);
Unserialize(is, boost::get<1>(item), nType, nVersion);
Unserialize(is, boost::get<2>(item), nType, nVersion);
Unserialize(is, boost::get<3>(item), nType, nVersion);
Unserialize(is, std::get<0>(item), nType, nVersion);
Unserialize(is, std::get<1>(item), nType, nVersion);
Unserialize(is, std::get<2>(item), nType, nVersion);
Unserialize(is, std::get<3>(item), nType, nVersion);
}
+11 -11
View File
@@ -44,7 +44,7 @@ Notes:
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <boost/lexical_cast.hpp>
#include <string>
#include <boost/algorithm/string/predicate.hpp>
@@ -54,7 +54,7 @@ Notes:
#include "txdb.h"
#include "lz4/lz4.c"
#include "lz4/lz4.h"
#include "xxhash/xxhash.h"
#include "xxhash/xxhash.c"
@@ -627,7 +627,7 @@ void ThreadSecureMsg(void* parg)
{
if (fDebugSmsg)
printf("Removing bucket %"PRId64" \n", it->first);
std::string fileName = boost::lexical_cast<std::string>(it->first) + "_01.dat";
std::string fileName = std::to_string(it->first) + "_01.dat";
fs::path fullPath = GetDataDir() / "smsgStore" / fileName;
if (fs::exists(fullPath))
{
@@ -641,7 +641,7 @@ void ThreadSecureMsg(void* parg)
printf("Path %s does not exist \n", fullPath.string().c_str());
// -- look for a wl file, it stores incoming messages when wallet is locked
fileName = boost::lexical_cast<std::string>(it->first) + "_01_wl.dat";
fileName = std::to_string(it->first) + "_01_wl.dat";
fullPath = GetDataDir() / "smsgStore" / fileName;
if (fs::exists(fullPath))
{
@@ -868,7 +868,7 @@ int SecureMsgBuildBucketSet()
std::string stime = fileName.substr(0, sep);
int64_t fileTime = boost::lexical_cast<int64_t>(stime);
int64_t fileTime = std::stoll(stime);
if (fileTime < now - SMSG_RETENTION)
{
@@ -2224,7 +2224,7 @@ bool SecureMsgScanBuckets()
std::string stime = fileName.substr(0, sep);
int64_t fileTime = boost::lexical_cast<int64_t>(stime);
int64_t fileTime = std::stoll(stime);
if (fileTime < now - SMSG_RETENTION)
{
@@ -2378,7 +2378,7 @@ int SecureMsgWalletUnlocked()
std::string stime = fileName.substr(0, sep);
int64_t fileTime = boost::lexical_cast<int64_t>(stime);
int64_t fileTime = std::stoll(stime);
if (fileTime < now - SMSG_RETENTION)
{
@@ -2769,7 +2769,7 @@ int SecureMsgRetrieve(SecMsgToken &token, std::vector<unsigned char>& vchData)
//printf("token.offset %"PRId64".\n", token.offset); // DEBUG
int64_t bucket = token.timestamp - (token.timestamp % SMSG_BUCKET_LEN);
std::string fileName = boost::lexical_cast<std::string>(bucket) + "_01.dat";
std::string fileName = std::to_string(bucket) + "_01.dat";
fs::path fullpath = pathSmsgDir / fileName;
//printf("bucket %"PRId64".\n", bucket);
@@ -2972,7 +2972,7 @@ int SecureMsgStoreUnscanned(unsigned char *pHeader, unsigned char *pPayload, uin
int64_t bucket = psmsg->timestamp - (psmsg->timestamp % SMSG_BUCKET_LEN);
std::string fileName = boost::lexical_cast<std::string>(bucket) + "_01_wl.dat";
std::string fileName = std::to_string(bucket) + "_01_wl.dat";
fs::path fullpath = pathSmsgDir / fileName;
FILE *fp;
@@ -3073,7 +3073,7 @@ int SecureMsgStore(unsigned char *pHeader, unsigned char *pPayload, uint32_t nPa
return 1;
};
std::string fileName = boost::lexical_cast<std::string>(bucket) + "_01.dat";
std::string fileName = std::to_string(bucket) + "_01.dat";
fs::path fullpath = pathSmsgDir / fileName;
FILE *fp;
@@ -3468,7 +3468,7 @@ int SecureMsgEncrypt(SecureMessage& smsg, std::string& addressFrom, std::string&
return 8;
};
int lenComp = LZ4_compress((char*)message.c_str(), (char*)&vchCompressed[0], lenMsg);
int lenComp = LZ4_compress_default((char*)message.c_str(), (char*)&vchCompressed[0], lenMsg, worstCase);
if (lenComp < 1)
{
printf("Could not compress message data.\n");
+5 -5
View File
@@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(base58_DecodeBase58)
}
// Visitor to check address type
class TestAddrTypeVisitor : public boost::static_visitor<bool>
class TestAddrTypeVisitor
{
private:
std::string exp_addrType;
@@ -79,7 +79,7 @@ public:
};
// Visitor to check address payload
class TestPayloadVisitor : public boost::static_visitor<bool>
class TestPayloadVisitor
{
private:
std::vector<unsigned char> exp_payload;
@@ -150,7 +150,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_parse)
BOOST_CHECK_MESSAGE(addr.IsValid(), "!IsValid:" + strTest);
BOOST_CHECK_MESSAGE(addr.IsScript() == (exp_addrType == "script"), "isScript mismatch" + strTest);
CTxDestination dest = addr.Get();
BOOST_CHECK_MESSAGE(boost::apply_visitor(TestAddrTypeVisitor(exp_addrType), dest), "addrType mismatch" + strTest);
BOOST_CHECK_MESSAGE(std::visit(TestAddrTypeVisitor(exp_addrType), dest), "addrType mismatch" + strTest);
// Public key must be invalid private key
secret.SetString(exp_base58string);
@@ -213,7 +213,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen)
continue;
}
CTrianglesAddress addrOut;
BOOST_CHECK_MESSAGE(boost::apply_visitor(CTrianglesAddressVisitor(&addrOut), dest), "encode dest: " + strTest);
BOOST_CHECK_MESSAGE(std::visit(CTrianglesAddressVisitor(&addrOut), dest), "encode dest: " + strTest);
BOOST_CHECK_MESSAGE(addrOut.ToString() == exp_base58string, "mismatch: " + strTest);
}
}
@@ -221,7 +221,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen)
// Visiting a CNoDestination must fail
CTrianglesAddress dummyAddr;
CTxDestination nodest = CNoDestination();
BOOST_CHECK(!boost::apply_visitor(CTrianglesAddressVisitor(&dummyAddr), nodest));
BOOST_CHECK(!std::visit(CTrianglesAddressVisitor(&dummyAddr), nodest));
// Restore global state
fTestNet = fTestNet_stored;
+1 -1
View File
@@ -1,6 +1,6 @@
#include <boost/assert.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/tuple/tuple.hpp>
#include <tuple>
#include <openssl/ec.h>
#include <openssl/err.h>
+6 -4
View File
@@ -25,16 +25,18 @@ echo "Configuring Tor static library build from: $TOR_SRC_DIR"
--disable-manpage \
--disable-html-manual \
--disable-unittests \
--disable-tool-name-check
--disable-tool-name-check \
--with-libevent-dir="${LIBEVENT_DIR:-/mingw64}" \
--with-openssl-dir="${OPENSSL_DIR:-/mingw64}" \
--with-zlib-dir="${ZLIB_DIR:-/mingw64}"
echo "Building Tor"
make -j"${NPROC:-$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 4)}"
echo
echo "Build finished. Inspect these locations for static libraries:"
echo " $TOR_SRC_DIR/src/core"
echo " $TOR_SRC_DIR"
echo " $TOR_SRC_DIR/src/lib"
echo " $TOR_SRC_DIR/src/trunnel"
echo
echo "Suggested next step for Triangles:"
echo ' make -f src/makefile.unix USE_TOR_EMBEDDED=1'
echo ' make -f src/makefile.unix USE_TOR_EMBEDDED=1 TOR_SOURCE_ROOT=src/tor/tor-src'
+1 -1
View File
@@ -22,10 +22,10 @@
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/shared_ptr.hpp>
#include <memory>
#include <list>
#define printf OutputDebugStringF
+1 -1
View File
@@ -53,7 +53,7 @@ static const int MEMPOOL_GD_VERSION = 60002;
#define DISPLAY_VERSION_MAJOR 5
#define DISPLAY_VERSION_MINOR 3
#define DISPLAY_VERSION_REVISION 0
#define DISPLAY_VERSION_REVISION 2
#define DISPLAY_VERSION_BUILD 0
#endif
+3 -2
View File
@@ -14,6 +14,7 @@
#include "addressindex.h"
#include <boost/algorithm/string/replace.hpp>
#include <algorithm>
#include <random>
#include <deque>
using namespace std;
@@ -1477,7 +1478,7 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, unsigned int nSpendTime,
vector<pair<int64_t, pair<const CWalletTx*,unsigned int> > > vValue;
int64_t nTotalLower = 0;
random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt);
std::shuffle(vCoins.begin(), vCoins.end(), std::mt19937(GetRandInt(std::numeric_limits<int>::max())));
for (COutput output : vCoins)
{
@@ -1698,7 +1699,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
CScript scriptChange;
// coin control: send change to custom address
if (coinControl && !boost::get<CNoDestination>(&coinControl->destChange))
if (coinControl && !std::get_if<CNoDestination>(&coinControl->destChange))
scriptChange.SetDestination(coinControl->destChange);
// no coin control: send change to newly generated address
+2 -2
View File
@@ -47,7 +47,7 @@ bool CWalletDB::WriteAccount(const string& strAccount, const CAccount& account)
bool CWalletDB::WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry)
{
return Write(boost::make_tuple(string("acentry"), acentry.strAccount, nAccEntryNum), acentry);
return Write(std::make_tuple(string("acentry"), acentry.strAccount, nAccEntryNum), acentry);
}
bool CWalletDB::WriteAccountingEntry(const CAccountingEntry& acentry)
@@ -80,7 +80,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountin
// Read next record
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
if (fFlags == DB_SET_RANGE)
ssKey << boost::make_tuple(string("acentry"), (fAllAccounts? string("") : strAccount), uint64_t(0));
ssKey << std::make_tuple(string("acentry"), (fAllAccounts? string("") : strAccount), uint64_t(0));
CDataStream ssValue(SER_DISK, CLIENT_VERSION);
int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags);
fFlags = DB_NEXT;
+9 -5
View File
@@ -331,6 +331,7 @@ SOURCES += src/qt/triangles.cpp src/qt/trianglesgui.cpp \
src/version.cpp \
src/sync.cpp \
src/smessage.cpp \
src/lz4/lz4.c \
src/util.cpp \
src/netbase.cpp \
src/key.cpp \
@@ -557,8 +558,7 @@ contains(USE_ZMQ, 1) {
# Embedded Tor support (optional)
# Build with:
# qmake "USE_TOR_EMBEDDED=1" "TOR_INCLUDE_PATH=src/tor/tor-src/src/feature/api" \
# "TOR_LIB_PATH=src/tor/tor-src/src/core src/tor/tor-src/src/lib src/tor/tor-src/src/trunnel"
# qmake "USE_TOR_EMBEDDED=1" "TOR_SOURCE_ROOT=src/tor/tor-src"
contains(USE_TOR_EMBEDDED, 1) {
message(Building with embedded Tor support)
DEFINES += ENABLE_TOR_EMBEDDED
@@ -572,7 +572,7 @@ contains(USE_TOR_EMBEDDED, 1) {
}
isEmpty(TOR_LIB_PATH) {
TOR_LIB_PATH = $$TOR_SOURCE_ROOT/src/core $$TOR_SOURCE_ROOT/src/lib $$TOR_SOURCE_ROOT/src/trunnel
TOR_LIB_PATH = $$TOR_SOURCE_ROOT
}
!isEmpty(TOR_INCLUDE_PATH) {
@@ -583,10 +583,11 @@ contains(USE_TOR_EMBEDDED, 1) {
LIBS += -L$$path
}
# Default static library set for Tor 0.4.8/0.4.9 style builds.
# Default static library set for the imported Tor 0.4.9.x tree.
# A full upstream build emits a top-level libtor.a aggregator.
# Override with TOR_EMBEDDED_LIBS from the qmake command line if needed.
isEmpty(TOR_EMBEDDED_LIBS) {
TOR_EMBEDDED_LIBS = -ltor-app -lor -lor-ctime -lor-event -lor-trunnel
TOR_EMBEDDED_LIBS = -ltor
}
unix {
@@ -594,6 +595,9 @@ contains(USE_TOR_EMBEDDED, 1) {
} else {
LIBS += $$TOR_EMBEDDED_LIBS
}
LIBS += -llzma -lzstd
windows:LIBS += -liphlpapi
}
system($$QMAKE_LRELEASE -silent $$_PRO_FILE_)