- DoS_tests: remove extra arg from VerifySignature calls (5 -> 4 params)
- accounting_tests: int64 -> int64_t for modern compilers
- CI: bump VERSION 5.3.5 -> 5.3.6
- Snap/Flatpak: fix asset URLs to match CI naming convention
- Add AppStream metainfo for store listings
- Add DNS2 seed node setup guide
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Implement bucket file rotation (split at ~1.75GB) to fix 2GB limit TODO
- Add SecMsgToken::fileIndex to track which rotated file each message is in
- Replace 3 duplicated filename parsers with SecureMsgParseBucketFilename()
- Add CSecureMsgThreadGuard with atomic counter for reliable thread shutdown
- Replace MilliSleep(3000) hack with SecureMsgWaitForThreadsToStop() (5s deadline)
- Fix file handle leak: missing fclose(fp) before return on fseek failure
- Fix message count: use insert().second instead of set size after loop
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Major sync performance improvements while preserving consensus:
- Header-first sync planner: receives and caches headers ahead of block
downloads, building a verified chain-trust map. Uses a sliding download
window (128 blocks in-flight, 30s timeout) to request blocks in order
from the best known header chain.
- Merged DB transactions: AddToBlockIndex and SetBestChain now share a
single LevelDB WriteBatch, halving the per-block commit count.
- Multi-peer block requests: pipeline refill and stall recovery now send
getblocks+getheaders to ALL connected full-node peers, not just one.
- LevelDB tuning: 64MB write buffer (vs 4MB default), 1000 max open files
for reduced memtable flush frequency during IBD.
- Larger getdata batches: 4000 items during IBD (vs 1000) to reduce
round-trip overhead with small PoS blocks.
- Tighter stall detection: 5-second timeout (vs 10s) for faster rotation
away from slow peers.
- Higher orphan limit during IBD: 4000 (vs 750) to prevent eviction and
re-download when blocks arrive out-of-order from parallel peers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add unit test build+run steps to both Qt and headless Linux CI jobs
- Enhance getnetworkinfo RPC with networkhealth object (peer mix, bootstrap mode, sync status)
- Rewrite Checkpoints_tests to validate actual chain checkpoints (0, 9000, 9001, 2186940)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
During sync, NotifyTransactionChanged fires for every wallet tx in
every block, each triggering 3 blocking LOCK(cs_wallet) calls on
the UI thread: updateWallet, GetAllBalances, getNumTransactions.
With the block processing thread holding cs_wallet almost continuously,
the UI thread blocks waiting for the lock - causing "not responding".
Fixes:
- GetAllBalances: LOCK → TRY_LOCK, returns false if busy
- updateWallet (tx table): LOCK → TRY_LOCK, skips if busy
- updateTransaction: removed checkBalanceChanged() call entirely
(pollBalanceChanged timer handles it every 2.5s with TRY_LOCK)
- getNumTransactions: replaced with rowCount() from cached model
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On Linux, int64_t is long but qint64 is long long - different types
that can't bind to the same reference. Use int64_t locals to match
the GetAllBalances signature.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove time-based sync check that showed "out of sync" when blocks
were >6 hours old. For PoS chains with few stakers, blocks can be
hours apart - that's idle, not out of sync. Now uses block count
only. Also adds periodic UI refresh every 30s and switches cached
stake weight from volatile to std::atomic.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes C++11 literal-suffix warnings in util.h, net.h, and alert.cpp.
Required space between string literal and macro per C++11 standard.
No functional changes - formatting only.
- Add CLEANUP_NOTES.md documenting cleanup strategy
- Add TODO_DOCUMENTATION.md with detailed context for all TODOs
- Improve inline comments for thread safety issue in rpcmining.cpp
- Clarify potential collision note in walletmodel.cpp
- Remove unclear 'DRM' comment, replace with descriptive text
No functional changes - documentation only.
Move GetStakeWeight() off the UI thread by caching in the staking
miner thread. Replace blocking LOCK(cs_vNodes) with TRY_LOCK in
clientmodel and staking icon updates. Fix out-of-sync label getting
stuck when disconnected. Add daemon bootstrap and faster IBD pipeline.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Daemon: add -bootstrap flag to download chain files from server on startup
- Qt: bootstrap prompt shows every launch with "Don't show this again" checkbox
- IBD: reduce pipeline refill interval from 1000 to 100 blocks for faster sync
- Add bootstrap.o to daemon makefiles (mingw + unix)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Peer connectivity (small network optimizations):
- Reduce hardcoded seed fallback delay from 30s to 10s
- Reduce peer retry interval from 600s to 120s
- Lower staking minimum peers from 3 to 1
- Relay addr messages to all connected peers instead of just 2
UI responsiveness:
- Add progress reporting to ScanForWalletTransactions (every 10K blocks)
- Use TRY_LOCK in WalletModel::pollBalanceChanged to avoid blocking UI
- Use TRY_LOCK in TransactionTablePriv::refreshWallet with retry
Auto-bootstrap:
- Add bootstrap.h/cpp with HTTP download via boost::asio
- On first run, prompt user to download blockchain snapshot from
bootstrap.cryptographic-triangles.org directly into data directory
- Downloads filelist.txt manifest then each file with progress dialog
- Falls back to IP 194.233.88.206 if DNS fails
- Gracefully continues to P2P sync if bootstrap unavailable
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
- 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>
- 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>
- 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>
- 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>
Changes improve sync speed without changing consensus:
- dbcache: 128MB → 2048MB (better caching during sync)
- checkblocks: 2500 → 24 (faster startup validation)
- checklevel: 1 → 2 (lighter verification during sync)
These changes make the node faster to sync and restart while maintaining
security and consensus compatibility.
Moved setOrganizationName/setApplicationName calls BEFORE
IntroDialog::pickDataDirectory() so QSettings knows where to save the
user's data directory choice.
Previously, QSettings was created without org/app names set, causing
the "strDataDir" setting to be lost, forcing the dialog to appear on
every startup.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed missing braces in CNode constructor (net.h:327-329) that caused
PushVersion() to execute unconditionally for ALL connections instead of
only outbound connections.
This bug caused inbound peers (seed nodes) to:
1. Send version on connection (unintended)
2. Send version again when receiving peer's version (intended)
3. Trigger Misbehaving(1) on peer side for duplicate version
4. Get disconnected by peer (ProcessMessage fails → CloseSocketDisconnect)
Result: Seed nodes could only serve ~120 blocks before disconnect,
making sync nearly impossible.
Bump version to 5.2.1.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Verbose logging at every critical sync pipeline stage:
- Version handler: whether getblocks was sent and why
- Inv handler: count of new vs already-known blocks
- Block handler: every block received (throttled), ProcessBlock failures
- ProcessBlock: CheckBlock failures with details
- SendMessages: stall detection with queue sizes
- Periodic status: height, peers, askfor queue, orphan count
- Getblocks handler: what range the seed is serving
All lines prefixed with IBD-DIAG for easy grep.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DNS2 was sending a stale sync checkpoint (block 2,186,940) to DNS3
on connect. ProcessSyncCheckpoint then called PushGetBlocks with the
checkpoint hash as the stop point, and AskFor'd block 2,186,940
directly — overriding the normal sequential getblocks chain. DNS3
would request a block it can't process (missing 2M predecessors)
instead of syncing from genesis.
Fix: ignore incoming checkpoint messages entirely (master key was
already removed in V5 fork, no new checkpoints possible). Also stop
relaying stored checkpoint messages to new peers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of skipping the anti-spam difficulty check during IBD, fix it
properly:
- Fall back to pindexBest when sync checkpoint is genesis (height 0)
- Add NULL safety for GetLastBlockIndex in both PoS and PoW cases
- PoS case: if no PoS block exists yet (below 9001), skip gracefully
since AcceptBlock already rejects PoS below MODIFIER_INTERVAL_SWITCH
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The anti-spam check in ProcessBlock used GetLastSyncCheckpoint() which
pointed to genesis after our reset. When processing PoS blocks,
GetLastBlockIndex(genesis, true) returned NULL (no PoS blocks at genesis),
causing a crash or Misbehaving(100) which banned the seed node.
Fix: skip the entire anti-spam check during IBD - hardcoded checkpoints
already guarantee chain integrity. Also add NULL safety for the PoS
case after IBD completes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
version.h had a separate DISPLAY_VERSION set (5.1.7.0) used by
version.cpp for the user-visible version string. clientversion.h
was updated but version.h was not, causing binaries to report
v5.1.7.0 despite being built from v5.2.0 source.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The sync checkpoint (hashSyncCheckpoint) was persisted in LevelDB pointing
to block 2,186,940. On startup it was loaded from DB, overriding any code
change to the initial value. CheckSync then rejected every block below
that height during IBD since they weren't in mapBlockIndex yet.
Three-pronged fix:
- CheckSync now always returns true (master key disabled, no new sync
checkpoints will ever be broadcast)
- AcceptBlock no longer calls sync checkpoint enforcement
- LoadBlockIndex resets sync checkpoint to genesis if stored hash is
not in the block index (prevents assert crash)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hashSyncCheckpoint was initialized to block 2,186,940 hash, causing
CheckSync to reject ALL blocks below that height during initial block
download (they aren't in mapBlockIndex yet when checked). Changed to
genesis hash so IBD can proceed from block 0.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Major sync performance overhaul:
- Assumevalid: skip FetchInputs/ConnectInputs for blocks below
checkpoint (2,186,940). Only write txindex entries. Eliminates
millions of LevelDB reads during initial sync.
- Skip SyncWithWallets during IBD with automatic post-IBD wallet
rescan from genesis and SecureMsg chain scan.
- Skip wallet best-chain locator update during IBD so restarts
trigger proper rescan.
- Remove send/receive buffer limits (were 1MB/5MB, now unlimited).
The 1MB send buffer was the root cause of ~180 block stalls -
ProcessMessages stops reading when nSendSize >= SendBufferSize().
- Reduce IBD pipeline batch from 500 to 100 blocks for faster
re-requesting with near-instant block processing.
- Seed getblocks limit raised to 20000 during IBD (was 500).
- Faster message handler polling during IBD (10ms vs 100ms).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove IBD guards on SyncWithWallets and SetBestChain so wallet
transactions appear as blocks are connected. Log every 500 blocks
during sync instead of every 10,000.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds CTorProcess which finds and launches an external Tor binary as a
subprocess, providing a SOCKS5 proxy on port 19099 and a v3 hidden
service on port 24112. The wallet auto-detects Tor from common install
locations or the app directory. Falls back gracefully to clearnet-only
if Tor is not found. Also fixes Tor-only network restriction that
blocked IPv4/IPv6, and bumps version to 5.1.7.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shows an intro dialog on first launch letting users choose where to store
blockchain data. Saves the choice in QSettings so it only appears once.
Styled to match the existing Triangles dark theme.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Critical fix: revert initial sync from getheaders back to getblocks.
The headers-first change (05b1fd1) broke chain continuation — after
downloading the first 2000 blocks, fresh nodes would stall because
the getheaders path has no orphan-based continuation mechanism.
The getblocks/inv/orphan cycle is required for full chain sync.
Also adds getblocks fallback to the headers handler so if headers
are used via other paths, sync still continues.
Other changes:
- Extract REST API into separate rest.cpp/rest.h
- Add REST rate limiting and CORS support
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Bump version 5.1.4 → 5.1.5 across all source, CI, and packaging files
- Remove 157 build artifacts (build/*.o, release/*.dll, etc.) from git tracking
These were added before .gitignore existed and caused cross-platform CI failures
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The 'all: trianglesd.exe' target was defined after 'leveldb/libleveldb.a:'
making LevelDB the default target. Make would only build LevelDB and exit.
Move 'all' to before LevelDB so it becomes the default target (like
makefile.unix). Also pass explicit 'all' target in CI as belt-and-suspenders.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>