Modernize codebase: C++17, remove Tor v2, add embedded Tor scaffold, IBD speedups

- Replace ~290 BOOST_FOREACH with C++11 range-for across 41+ files
- Replace boost::assign::map_list_of with C++11 brace initialization
- Remove PAIRTYPE macro (no longer needed without BOOST_FOREACH)
- Guard OpenSSL locking callbacks for 3.x (no-ops in >= 1.1.0)
- Fix Qt deprecated APIs for Qt6 compat (QStyleOptionViewItemV4, setResizeMode)
- Add openssl_compat.h version string wrapper
- Enable C++17 in makefile.unix and triangles-qt.pro

- Delete 163 dead Tor v2 source files (~150K lines removed)
- Add embedded Tor scaffold (tor_embedded.h/cpp) using tor_api.h
- Add build-libtor.sh helper and CODEX-TOR-GUIDE.md
- Update makefile.unix and .pro with USE_TOR_EMBEDDED optional flag
- Fallback to external tor_process when not compiled with libtor

- IBD pipeline refill: 100 -> 1000 blocks
- Send/recv buffer limits: unlimited -> 100MB/32MB
- Orphan block cap: unlimited -> 750 with random eviction
- Socket poll: 10ms -> 1ms during IBD
- Message handler sleep: 10ms -> 1ms during IBD
- Stall detection timeout: 5s -> 2s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-19 01:51:15 -07:00
parent 0beca5d801
commit 383a3b8b02
235 changed files with 1325 additions and 151064 deletions
+3 -4
View File
@@ -5,7 +5,6 @@
#include "sync.h"
#include "util.h"
#include <boost/foreach.hpp>
#ifdef DEBUG_LOCKCONTENTION
void PrintLockContention(const char* pszName, const char* pszFile, int nLine)
@@ -58,14 +57,14 @@ static void potential_deadlock_detected(const std::pair<void*, void*>& mismatch,
{
printf("POTENTIAL DEADLOCK DETECTED\n");
printf("Previous lock order was:\n");
BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, s2)
for (const auto& i : s2)
{
if (i.first == mismatch.first) printf(" (1)");
if (i.first == mismatch.second) printf(" (2)");
printf(" %s\n", i.second.ToString().c_str());
}
printf("Current lock order is:\n");
BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, s1)
for (const auto& i : s1)
{
if (i.first == mismatch.first) printf(" (1)");
if (i.first == mismatch.second) printf(" (2)");
@@ -84,7 +83,7 @@ static void push_lock(void* c, const CLockLocation& locklocation, bool fTry)
(*lockstack).push_back(std::make_pair(c, locklocation));
if (!fTry) {
BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, (*lockstack)) {
for (const auto& i : (*lockstack)) {
if (i.first == c) break;
std::pair<void*, void*> p1 = std::make_pair(i.first, c);