Replace FutureDrift(GetAdjustedTime()) with GetTime() + 15min in CheckBlock
and header-sync validation. GetAdjustedTime() incorporates peer-reported
time offsets that vary between Tor nodes, causing the same block to be
accepted by some nodes and rejected by others — the primary cause of
persistent chain forks. AcceptBlock still enforces tight 3-min drift rules
deterministically against the previous block timestamp.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three fixes for the fork-oscillation problem where same-version nodes
keep disagreeing on the chain tip:
1. Prune setStakeSeen on reorg — disconnected PoS blocks' stake entries
were never removed, blocking acceptance of valid competing blocks
and preventing chain convergence after reorganizations.
2. Remove global nBestHeight from PastDrift/FutureDrift — the no-argument
overloads used the mutable global nBestHeight to decide between 3-min
and 10-min timestamp drift at the V5.4 fork boundary (block 2186941).
Nodes at different heights applied different validation rules to the
same block, causing a permanent consensus split. Now always uses
post-fork 3-min rules since all nodes are well past the fork.
3. Anti-oscillation for equal-trust reorgs — the hash-based tiebreaker
now only fires for shallow forks (parent in main chain). Deep forks
with equal trust no longer trigger reorgs, preventing the Tor-latency-
induced ping-pong where nodes flip between competing chains.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Address validator accepts V3 .onion format (62 chars, base32 + .onion)
- WalletModel::validateAddress() recognizes .onion via ValidateOnionAddress()
- Send coins/messages dialogs resolve .onion to TRI before sending
- Auto-request getwalletaddr from onion peers after version handshake
- Placeholder text updated to "Enter a TRI address or .onion address"
- Shows info dialog if resolution is pending (async connect + resolve)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New P2P messages allow resolving a peer's .onion address to their TRI
receiving address with cryptographic proof of ownership:
- getwalletaddr: request peer's TRI address
- walletaddr: response with address + compact signature
Resolution cache in CTorV3Manager with 24h expiry and async callbacks.
Signature verification prevents spoofing (peer signs their onion hostname
with their wallet key).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Lit green "V3" label next to staking icon when onion address is active,
dimmed grey when not yet connected. Tooltip: "V3 Tor enabled".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove onion address label from overview page (was cutting into
transaction list area)
- Add it to the left side of the main window status bar instead,
opposite the sync/connection icons
- Add "Show .onion address in status bar" checkbox under Options >
Display (enabled by default)
- Polls every 5 seconds; hidden until the address is available
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The defensive check `IsPortInUse(hiddenServicePort)` always fails
because port 24112 is the P2P port, which the node binds BEFORE
Tor starts. The check was incorrectly detecting our own listener
as a collision, causing "Tor failed to start" on every launch.
The hidden service is supposed to forward to 127.0.0.1:24112 where
the node is already listening — that's the correct state, not an error.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename CTorProcess::GetLastError() and CTorEmbedded::GetLastError() to
GetStartupError() so they don't shadow the Win32 GetLastError() API,
which caused a std::string-to-DWORD conversion error on Windows.
- Qualify the one Win32 call as ::GetLastError() for clarity.
- Pass torError.c_str() to strprintf instead of std::string, fixing
Clang's -Wnon-pod-varargs error on macOS.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move extern declarations to file scope so they resolve to global
symbols instead of the Boost test suite namespace. Cast static const
member to avoid ODR address requirement.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move extern declarations to file scope so they resolve to global
symbols instead of the Boost test suite namespace. Cast static const
member to avoid ODR address requirement.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The -Wl,-z,relro and -Wl,-z,now flags are ELF-specific and not
supported by macOS's linker. Guard them with if(NOT APPLE).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The -Wl,-z,relro and -Wl,-z,now flags are ELF-specific and not
supported by macOS's linker. Guard them with if(NOT APPLE).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CMake's AutoUic mistakenly treats ui_interface.h (a hand-written
Bitcoin-convention header) as a Qt Designer output and looks for
interface.ui which doesn't exist. Fix by disabling AutoUic and
explicitly running qt5_wrap_ui on the actual .ui files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CMake's AutoUic mistakenly treats ui_interface.h (a hand-written
Bitcoin-convention header) as a Qt Designer output and looks for
interface.ui which doesn't exist. Fix by disabling AutoUic and
explicitly running qt5_wrap_ui on the actual .ui files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ubuntu 22.04 ships Boost 1.74; the previous 1.75 minimum rejected it.
Also remove boost_system from required components since it has been
header-only since Boost 1.69 and modern installs (macOS Homebrew 1.90)
don't ship a separate cmake config for it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ubuntu 22.04 ships Boost 1.74; the previous 1.75 minimum rejected it.
Also remove boost_system from required components since it has been
header-only since Boost 1.69 and modern installs (macOS Homebrew 1.90)
don't ship a separate cmake config for it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- CMakeLists: add --start-group linking for libtor.a and its deps
(libevent, openssl, zlib, lzma, zstd) with --allow-multiple-definition
for mixed static/dynamic OpenSSL on Windows
- CMakeLists: define USE_UPNP=0 only when USE_UPNP is off (not via
#ifdef-incompatible define)
- net.cpp: guard USE_UPNP reference with #ifdef for builds without UPnP
- rpcwallet.cpp: replace nonexistent LogPrintf with printf
- tor_embedded.cpp: fix SOCKET type mismatch on Windows (SOCKET vs int)
- .gitignore: add testnet-sync/ directory
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- CMakeLists: add --start-group linking for libtor.a and its deps
(libevent, openssl, zlib, lzma, zstd) with --allow-multiple-definition
for mixed static/dynamic OpenSSL on Windows
- CMakeLists: define USE_UPNP=0 only when USE_UPNP is off (not via
#ifdef-incompatible define)
- net.cpp: guard USE_UPNP reference with #ifdef for builds without UPnP
- rpcwallet.cpp: replace nonexistent LogPrintf with printf
- tor_embedded.cpp: fix SOCKET type mismatch on Windows (SOCKET vs int)
- .gitignore: add testnet-sync/ directory
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- assumevalid flag to skip script verification for known-good blocks
- CCheckQueue thread pool for parallel signature/script validation
- Deferred wallet scan until after IBD completes
- Guard UPnP usage for builds without miniupnpc
- Fix LogPrintf -> printf in clearwallettransactions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- assumevalid flag to skip script verification for known-good blocks
- CCheckQueue thread pool for parallel signature/script validation
- Deferred wallet scan until after IBD completes
- Guard UPnP usage for builds without miniupnpc
- Fix LogPrintf -> printf in clearwallettransactions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove all json_spirit source files and add nlohmann/json (v3.11.3)
with a json_compat.h shim that preserves the json_spirit namespace
API. Updates all RPC and test files to use the new JSON backend.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove all json_spirit source files and add nlohmann/json (v3.11.3)
with a json_compat.h shim that preserves the json_spirit namespace
API. Updates all RPC and test files to use the new JSON backend.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove legacy build files (Makefile, makefile.unix/mingw/osx,
triangles-qt.pro) and replace with CMake build system. Includes
find modules for all dependencies, LevelDB bundled build, and
updated CI workflow for CMake + Ninja on all platforms.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove legacy build files (Makefile, makefile.unix/mingw/osx,
triangles-qt.pro) and replace with CMake build system. Includes
find modules for all dependencies, LevelDB bundled build, and
updated CI workflow for CMake + Ninja on all platforms.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DISPLAY_VERSION in version.h was still at 5.5.5 while CLIENT_VERSION
in clientversion.h was bumped to 5.5.6. Also fix Tor binary finder
to skip directories (was matching /usr/lib/.../tor/ dir instead of
the tor binary inside it).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DISPLAY_VERSION in version.h was still at 5.5.5 while CLIENT_VERSION
in clientversion.h was bumped to 5.5.6. Also fix Tor binary finder
to skip directories (was matching /usr/lib/.../tor/ dir instead of
the tor binary inside it).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>